wood burning stoves 2.0*
The moose likes Struts and the fly likes Uploading Images using Struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Uploading Images using Struts" Watch "Uploading Images using Struts" New topic
Author

Uploading Images using Struts

Vikram Virk
Greenhorn

Joined: Mar 13, 2006
Posts: 8
I want to know how can I restrict the size and type of file being uploaded using Struts.My application is uploading any type of file.I am saving file to a folder in my harddisk.
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Look at the upload example in the struts-examples.war file that comes with the Struts download. It gives an example of how to give an error message if the uploaded file exceeds a certain size. As for restricting what types of files to upload, you could simply look at the file extension and accept or reject a file based on that.


Merrill
Consultant, Sima Solutions
 
jQuery in Action, 2nd edition
 
subject: Uploading Images using Struts
 
Similar Threads
Encryption of file while uploading
JMeter file upload problem.Please help
How to upload only image file
uploading a file but want to restrict the type of files
Height and width of image from file upload