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.
posted 9 years ago
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.