This article is mainly written about struts2 file upload and download (Chinese file name problem resolution).
When using, enter directly in the Address bar: http://localhost:8080/fud/Enter
Detailed configuration is shown in the following code:
Configuration of the Struts.xml file
[XHTML] View Plain Copy <?xml version= "1.0" encoding= "UTF-8" ?> <! doctype struts public "-//apache software foundation//dtd struts configuration 2.1//en " " HTTP://STRUTS.APACHE.ORG/DTDS/STRUTS-2.1.DTD "> <struts> <!-- Setting the default encoding format --> < Constant name= "struts.i18n.encoding" value= "GBK" /> <! -- Setting the maximum upload file is 300m --> <constant name= " Struts.multipart.maxSize " value=" 314572800 " /> <!-- Set the default temporary file storage location --> <constant name= "Struts.multipart.saveDir" value= "C:/fileupload" /> <!-- setting debug mode --> <constaNt name= "Struts.devmode" value= "true" ></constant> < Package name= "FileUpload" extends= "Struts-default" namespace= "/file" > <!-- File upload --> <action name= "Upload" class= "com.file.action.FileUploadAction" > <result type= " Redirectaction "> <param name= "ActionName" >list</param> <param name= "namespace" >/ file</param> </ result> &NBSP;&NBsp; </action> <!-- Download files --> <action name= "Download" class= "com.file.action.FileDownloadAction" > <result type= "Stream" name= "Success" >