Struts 2 File Upload Interceptor configuration problems

前端 未结 4 1296
我寻月下人不归
我寻月下人不归 2021-02-09 08:11

I\'m having two problems when trying to configure the Struts 2 File Upload Interceptor in my application. I want to change the parameter maximumSize (the default va

4条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-09 08:35

    Finally solved the entire puzzle! struts.xml and MessageResource.properties were correctly configured. The problem was struts.multipart.maxSize value. This value have to be bigger than the desired upload limit (5242880 in my app), so I set it as 10000000. If struts.multipart.maxSize value is equal or less then fileUpload.maximumSize the library used by Struts 2 to do the upload stops the upload process (and writes the error message) before the file upload interceptor has a chance to do its job.

提交回复
热议问题