File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Other Open Source Projects and the fly likes apache commons - file upload Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "apache commons - file upload" Watch "apache commons - file upload" New topic

apache commons - file upload

Greeshma Sanigar

Joined: Oct 23, 2008
Posts: 3
Hello All,

I'm using apache commons fileupload to upload a file ...I need to throw an error message if the file is not found, this happens if the user mistypes the path or edits the browsed path ... I can check the size but it is also possible to upload a file with 0 bytes...

Help is greatly appreciated..

Rob Spoor

Joined: Oct 27, 2005
Posts: 20273


Your name violates our naming policy. Please change it accordingly.

Thank you,


How To Ask Questions How To Answer Questions
Tha�s Manfrim Firmino
Ranch Hand

Joined: Apr 12, 2004
Posts: 48
Please post your code so it's easier to say what to modify.

Tha�s M. K. M. Firmino
Tha�s Manfrim Firmino
Ranch Hand

Joined: Apr 12, 2004
Posts: 48
I was wondering... when you read the request on the server side maybe you will be no able anymore to distinguish if the file exists or not since you said you can accept empty files.

What about doing a local validation before sending the file name to the server? I mean, you can create a function before submiting the form verifying if the file exists (so it will be done on the local machine).

I hope my suggestion help. Please let me know if you need further explanation.

Good luck!
I agree. Here's the link:
subject: apache commons - file upload
It's not a secret anymore!