I have a requirement in which I need to check the file size which is being uploaded. I have a limit of 10 MB, more than which I should not allow the upload. As I tried client side validation, and was successful only with mozilla and firefox as they support file.size functionality. IE on the other needs support of ActiveX which is denied.
Coming to Client side validation, I am checking if request.getContentLength greater than 10 MB, then redirect to error page.
It works great for files around 100 or 200 MB. I tried for 2 GB file, the redirect takes forever, and the timeout set is 60 secs. Still I am not able to load the error Page. Any suggestion why the redirect is not happening if the file sizes are huge ?
By timeout you mean session timeout?
If there is no redirect after say 10 secs, directly call the error page.
Not sure if this is what you are looking for.
One more thing is use a Flash based uploader which is quite sophisticated than the traditional ones.
I have done the server side validation by checking the file size using the getContentLength.
The condition check is fine, but the call is looped between server and client machine for infinite time.
What could be the possible reasons about why the call is looped between server and client(in JSP and Servlet scenario) and during this period the client browser seems to be loading all the time. The target JSP is never shown though the call is forwarded to that JSP(this I verified from the logs).