File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

apache commons - file upload

 
Greeshma Sanigar
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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..

Thanks...
 
Rob Spoor
Sheriff
Pie
Posts: 20381
46
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"greesh",

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

Thank you,

Rob
 
Tha�s Manfrim Firmino
Ranch Hand
Posts: 48
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please post your code so it's easier to say what to modify.
 
Tha�s Manfrim Firmino
Ranch Hand
Posts: 48
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic