Hello All :)
Previously I have posted about uploading and downloading files from server path (Refer this post for more clarification), In that post I have described the process of uploading single file at a time but sometimes we need to upload multiple files at a time and for that requirement we can use same code with little modification
So In this post we'll see that how can we upload multiple files at a time using af:inputFile, Here I am using same sample application that is used in previous post
Default inputFile source looks like this
To enable multiple files selection in af:inputFile we have to set some properties
and what rows and maximumFiles properties means ?
|rows||int||Yes||an attribute that determines the number of rows in the file list. There will be a scrollbar which will be displayed when the number of files exceeds this number.|
|maximumFiles||int||Yes||an attribute that is used to restrict the number of files a user can upload. If the user tries to upload more files than specified in maximumFiles then an error is returned. If maximumFiles is less than 1 then the number of files is unlimited.|
After setting these properties inputFile looks like this
Now UI part is done , next is code part so to get and upload multiples files from client we have to use a List data structure and then in value change listener we'll traverse that List and upload all files to server path.
ValueChangeListener of af:inputFile-
AMImpl Method to check duplicate file-
For other methods and DB table refer previous post Uploading and downloading files from absolute server path
So All done for multiple files upload now run and check application
Sample ADF Application (Jdeveloper 12.1.3)- Download
Cheers :) Happy Learning