Hi
I am using primefaces-ui-0.9.3.jar in my application for the Multiple File upload functionality.
I have embedded inside <p:dialog> tag the following:
<p:fileUpload fileUploadListener="#{fileUploadController.uploadFile}" multiple="true" label="Browse" allowTypes="*.jpg;*.png;*.gif;" description="Images"/>
Hence, I am able to show the uploading tool in a dialog. However, there is a need that:
(1) Once all the files have been uploaded by the upload tool, I need the total number of files successfully uploaded (also their names, sizes) in a javascript variable or a Html input field.
(2) Further, I also need to restrict the user from uploading more than 5 files at a time.
Is there a way to achieve these two needs in Primefaces?
Regards
Biswajit
File Upload - Query on Multiple upload feature
-
- Prime
- Posts: 18616
- Joined: 05 Jan 2009, 00:21
- Location: Cybertron
- Contact:
Hi biswajit,
Why don't you do these checks on server side with file upload listener, you can keep track of uploaded files each time uploadListener is called.
Why don't you do these checks on server side with file upload listener, you can keep track of uploaded files each time uploadListener is called.
Hi
Condition 1): server side logic works.
Condition 2): I want to restrict the user from uploading more than 5 files at a time. If I let the user to upload any number of files, and check this restriction of 5 files in server side, it is an unnecessary extra work I have to do, further it is confusing for the user, and I think a user will always prefer to be informed of this restriction whenever he selects more than 5 files in the tool, instead of getting a server reply that 'cannot upload more than 5 files' after he has clicked the upload link.
In addition to these two queries, can you please let me know if I am using CustomUI option, how can I upload the files [ I mean how can I call the methods upload() and clear()] since as per the p:fileUpload tag lib there is no attribute 'widgetVar' defined for this tag, though in the guide pdf an example of fileUpload shows <widgetVar>.upload();
Condition 1): server side logic works.
Condition 2): I want to restrict the user from uploading more than 5 files at a time. If I let the user to upload any number of files, and check this restriction of 5 files in server side, it is an unnecessary extra work I have to do, further it is confusing for the user, and I think a user will always prefer to be informed of this restriction whenever he selects more than 5 files in the tool, instead of getting a server reply that 'cannot upload more than 5 files' after he has clicked the upload link.
In addition to these two queries, can you please let me know if I am using CustomUI option, how can I upload the files [ I mean how can I call the methods upload() and clear()] since as per the p:fileUpload tag lib there is no attribute 'widgetVar' defined for this tag, though in the guide pdf an example of fileUpload shows <widgetVar>.upload();
Regards
Biswajit
Biswajit
-
- Posts: 1
- Joined: 10 May 2013, 06:59
Hi biswajit,
Did you find any solution for your problem(Condition:2 - Restricting user from selecting more than 5 files). We are using Primefaces in our project and we are stuck up with this problem. It will be more helpful if you post the solution for this problem.
Thanks,
monarathin
Did you find any solution for your problem(Condition:2 - Restricting user from selecting more than 5 files). We are using Primefaces in our project and we are stuck up with this problem. It will be more helpful if you post the solution for this problem.
Thanks,
monarathin
- andyba
- Expert Member
- Posts: 2473
- Joined: 31 Mar 2011, 16:27
- Location: Steinfeld, near Bremen/Osnabrück, DE
- Contact:
You need to read the forum rules!monarathin wrote:Hi biswajit,
Did you find any solution for your problem(Condition:2 - Restricting user from selecting more than 5 files). We are using Primefaces in our project and we are stuck up with this problem. It will be more helpful if you post the solution for this problem.
Thanks,
monarathin
The chances of getting a reply from a 3 year old thread are nil.
PF 4.x (Elite versions), PF 5, Pf 5.1, PF 6.0
Glassfish 4.1, Mojarra 2.x, Java 8, Payara 4.1.1.
If you haven't read the forum rules read them now
Glassfish 4.1, Mojarra 2.x, Java 8, Payara 4.1.1.
If you haven't read the forum rules read them now
-
- Information
-
Who is online
Users browsing this forum: No registered users and 13 guests