Win a copy of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams this week in the Reactive Progamming forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

apache commons - file upload

 
Greenhorn
Posts: 3
  • 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...
 
Sheriff
Posts: 21802
104
Eclipse IDE Spring VI Editor Chrome Java Ubuntu Windows
  • 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
 
Ranch Hand
Posts: 48
  • 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
  • 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!
 
There's a way to do it better - find it. -Edison. A better tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!