I will like to load a picture and save it with an ID of the one that i am saving the record for. can any one help me.
I will like to load a picture and save it with an ID of the one that i am saving the record for. can any one help me.
The File Upload component enables users of your web application to locate a file on their system and upload that file to the server. This component is useful for collecting text files, image files, and other data. The contents of the uploaded file are stored together with some information about the file, including the file name, size, and MIME type (such as text/plain or image/jpeg).
The server holds the uploaded file in memory unless it exceeds 4096 bytes, in which case the server holds the file contents in a temporary file. You can change this threshold by modifying the sizeThreshold parameter for the UploadFilter filter entry in the web application's web.xml file. For more information on modifying the web.xml file, see the last section in this tutorial, Doing More: Modifying the Maximum File Upload Size.
In cases where you want to retain the uploaded file, you have three choices:
- Write the file to a location of your choice, as shown in this tutorial.
- Create an UploadedFile property in a managed bean and set it to the component's value before you exit the page (as in the button's action method).
- Save the file to a database.
By default, the File Upload component can handle files up to one megabyte in size. You can change the maximum file size by modifying the maxSize parameter for the UploadFilter filter entry in the application's web.xml file.
Bookmarks