Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Interrupting big file uploads to save traffic

 
Pushker Chaubey
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Experts,

When a huge file is uploaded, then is the request object available (and service invoked) only after the whole request body is materialized on server memory?

My problem is Whenever a huge file is uploaded I want to stop the upload as soon as I reach a limit of 20MB, thus avoiding the unnecessary traffic wastage.

I was thinking about checking for contentLength to find out the file size, but that will of no use if file has already been materialized on the server memory.

Any pointers on this are welcome!

Thanks and regards,
Pushker Chaubey
 
Travis Hein
Ranch Hand
Posts: 161
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess if you had some kind of client side widget, such as an applet, to make the users upload with, that could do a check before hand and enforce maximum file size before uploading.
 
Pushker Chaubey
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No. I just have plain html on the client side.

But I still wondering how is it possible to check the file size at client side using any applet code or javascript.

Thanks,
Pushker Chaubey
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic