Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

redirect takes infinite time

 
Ravi Saluru
Greenhorn
Posts: 11
Java MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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 ?

Thanks
 
Amit Ghorpade
Bartender
Posts: 2854
10
Fedora Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
By timeout you mean session timeout?
I think you can put a Javascript on the page which processes the redirect.
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.

Hope this helps.
 
Ravi Saluru
Greenhorn
Posts: 11
Java MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Flash is not supported, the validation has to be done at the server side!
 
Ravi Saluru
Greenhorn
Posts: 11
Java MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).

Thanks,
Ravi
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic