I'm running tomcat and Java EE. I am using apache's FileUpload library to handle file uploads. This is working great actually except when a user tries to upload a large file. There is a way to set a file limit using FileUpload but the entire request still goes through and the browser hangs the whole time. Is there a way to block large requests from even going through? Also is there a way to check file size client side so I can cut off most requests before they start?
Asked
Active
Viewed 1,914 times
0
-
1This is possible through `HTML5` >> http://stackoverflow.com/a/12674684/2093375 – Ravi Trivedi May 16 '13 at 02:28
-
1related http://stackoverflow.com/questions/14523632/cancel-fileupload-when-filesizemax-is-exceeded – leonbloy May 16 '13 at 02:28
-
@leonbloy So there is honestly no good server side way to stop a request from coming through that is too large? Possibly cutting it off if the request size is too large? Or is it as this article claims and the browser would not be able to get a response? – user439299 May 16 '13 at 02:34
1 Answers
0
How about using a Jquery fileupload plugin
https://github.com/blueimp/jQuery-File-Upload
This allows you to limit the size at the client side and prevent upload before it leaves the client.

Scary Wombat
- 44,617
- 6
- 35
- 64