File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes file size before upload with Jakarta commons FileUpload Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "file size before upload with Jakarta commons FileUpload" Watch "file size before upload with Jakarta commons FileUpload" New topic
Author

file size before upload with Jakarta commons FileUpload

Tina Desai
Ranch Hand

Joined: Mar 13, 2003
Posts: 365
Can we check the file size before upload starts? We can set the max limit but can I do something like check if the file is of some size before the actual upload starts?

I am using Jakarta Commons FileUpload.

Regards,
Tina


Alongwith being a good coder, try to be a good professional as well!
Chetan Parekh
Ranch Hand

Joined: Sep 16, 2004
Posts: 3636
Tina, you can�t determine the size of the file before you upload it.

You have an alternative to use Applet for uploading, where you can determine the size of the file before uploading. But you need signed applet for that. Problem is in this solution that, if you sign applet for MS JVM, it will not work with Sun JVM � and same is true for opposite.


My blood is tested +ve for Java.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: file size before upload with Jakarta commons FileUpload