aspose file tools*
The moose likes Servlets and the fly likes upload limit Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "upload limit" Watch "upload limit" New topic
Author

upload limit

Fernando Dominguez
Ranch Hand

Joined: Sep 01, 2006
Posts: 104

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

Joined: May 26, 2003
Posts: 30913
    
158

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.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: upload limit