Limiting the number of files that can be uploaded

Upload core product.
Post Reply
livingframe
Posts: 2
Joined: Thu May 28, 2009 2:28 pm

Limiting the number of files that can be uploaded

Post 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!

User avatar
support
Posts: 1503
Joined: Sun Jan 27, 2008 6:19 pm

Re: Limiting the number of files that can be uploaded

Post by support »

Try: <PARAM NAME="maxfiles" VALUE="1">

Does it help ?

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

livingframe
Posts: 2
Joined: Thu May 28, 2009 2:28 pm

Re: Limiting the number of files that can be uploaded

Post 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.

User avatar
support
Posts: 1503
Joined: Sun Jan 27, 2008 6:19 pm

Re: Limiting the number of files that can be uploaded

Post 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 ?

Post Reply