The framework comes with built in file upload support. Uploading a file is simple. When FilterDispatcher receives a request, it checks to see if the request contains multipart content. If it does the dispatcher creates a MultipartWrapperRequest. This wrapper handles receiving the file and saving to disk. It is important for the Action programmer to check to see if any errors occured during processing. Three properties can be set that effect file uploading.
Note |
---|
Ensure you have the necessary file upload libraries in your application. If using the default file upload parser, Commons Fileupload and its dependencies should be in your application's classpath. |
Properties
Properties can be set by putting a struts.properties
file in WEB-INF/classes
. Any property found in the properties file will override the default value.
...