Reputation: 65
I am using JSF 2.0, PF 3.0M3 and GF 2.1.
I want to upload a file by giving it a custom name. I would like to use multiple file upload feature of PF.
This is how I want it to be -
Choose Upload Cancel - PF controls for multiple file uploads.
Name: My first uploaded image File :- (selected from choose control of fileupload control) test.jpg
Name: My second image File: test2.jpg
After the user enters the custom names for file and presses upload button, it should save the file and custom name in db.
Is this possible using "Multiple" file upload feature?
Thanks.
Upvotes: 0
Views: 607
Reputation: 5096
I think the better solution would be to let the user upload the files he wants and then provide a dialog/panel
(or whatever) with an inputText and a submit button
, for every file uploaded, where the user can insert the new name of the file if he wants, because there may be files that he doesn't want/need to rename them. And you will have to implement a java class that renames the correct file.
If you want something more sophisticated, after uploading all the files, you could provide an interface showing all of them (if they are images, you can show a preview), or even a treeTable
with all the files, and then implement a contextMenu
for every selected file from the treeTable. This context menu could have a rename
subMenu item or even some delete
and download
items.
Upvotes: 0