Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

upload limit

 
Fernando Dominguez
Ranch Hand
Posts: 108
Debian Eclipse IDE Firefox Browser
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

Recently I have made a servlet to upload files to my aplication.
I needed to define the maximun size to upload.

The problem is that the size of the file is not checked until the file is fully uploaded.

Now, I'm using apache.commons.fileupload


Is there any way to check the size when the file is uploading?

Thanks in advance.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34974
379
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I haven't tried this, so it's more of speculation than an answer.

There is a streaming API in commons. If you were reading the stream, you could track how much is uploaded. You wouldn't be able to give the user a nice message as you'd have to just stop uploading at that point. But you could counter that with AJAX to state the server gave up.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic