• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Uploading Images using Struts

 
Vikram Virk
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic