When uploading a single file, it needs to be in Act. When uploading a file, you must make the form enctype Property is set to multipart/form-data, It's method Property is set to post 2.
【Java EE Study 35 Next 】【struts2】【struts2 Upload files 】【struts2 Custom interceptors 】【struts2 Manual verification 】.The following code inputs It's all text upload input DOM // Name information var nameStr='' // Size information var sizeStr=. struts2 File upload size limit problem summary ( quote )įinal solution : page js Control the size of uploaded files, Control on the page.One : First of all, look at the corresponding error message in the execution of the program, As shown below : 15:31:11 :Unable to parse request. struts2 File upload size limit problem summary.Problem : Upload big file report error …… solve : modify struts.xml The parameters in the file are as follows
The request was rejected because its size (51224434) exceeds the configured maximum (20971520)Ģ、fileUpload The interceptor maximumSize Property must be less than Value. and fileUpload The interceptor maximumSize The division of labor is differentġ、 Control the maximum number of files uploaded by the whole project size. Struts2 The default file upload size is 2M, To change the default size, Solutions such as the following :