Page 1 of 1

Limiting the number of files that can be uploaded

Posted: Thu May 28, 2009 2:32 pm
by livingframe
Hi there,

I'm just looking to see if it's possible to limit the number of files that can be uploaded using JFileUpload? We only want users to be able to upload 1 file at a time - ie. user drags the file over to the JFileUpload box, then adds some details about the file to a form and it then gets saved along with the form when the user clicks on 'save'. At the moment though users are able to upload several files to JFileUpload before filling out the form and clicking on save and this is causing problems.

Is there any way this can be limited to just 1 file at a time?

Many thanks!

Re: Limiting the number of files that can be uploaded

Posted: Thu May 28, 2009 7:14 pm
by support
Try: <PARAM NAME="maxfiles" VALUE="1">

Does it help ?

All parameters are detailed at:
http://www.jfileupload.com/products/jfi ... _http.html

Re: Limiting the number of files that can be uploaded

Posted: Fri May 29, 2009 10:57 am
by livingframe
Many thanks,

I tried adding this and it does stop the user from dragging more that 1 file over at once, however they can still drag a file over and then another file, then another file. It only stops them dragging multiple files over at the one time. What I'm looking for is a way to limit the user ao they can only drag 1 file over and once it has been uploaded, they can't add any more files.

Re: Limiting the number of files that can be uploaded

Posted: Mon Jun 01, 2009 8:06 am
by support
You have 2 solutions:

1 - Redirect after upload:
Use "forward" parameter to redirect after successfull upload. The applet will redirect to another web
page once upload is completed. That's way end-user cannot upload another file.

2 - Install JBatchUpload add-on and redirect after upload
This add-on allows end-user adding/removing files (in the limit of maxfiles) and then start upload.
You can also setup "forward" parameter to redirect when upload is completed.

Does it help ?