简体   繁体   中英

Unable to find 'struts.multipart.saveDir' property setting. Defaulting to javax.servlet.context.tempdir

While trying to upload the Image in struts2 the image is not uploading and showing following msg Unable to find struts.multipart.saveDir property setting. Defaulting to javax.servlet.context.tempdir

How to solve this problem

Can you show the code which you are using as that will always be helpful. you need to specify

struts.multipart.saveDir=

property in either struts.xml file as a constant entry or you need to specify that in struts.properties file choice is all yours.

struts.multipart.saveDir - The directory where the uploaded files will be placed. If this property is not set it defaults to javax.servlet.context.tempdir.

this is the case with your post since you have not specified the location by yourself so struts2 is picking up the temp location for file upload.

here is the link defining the details File Upload

edit in struts.xml

<struts>
    <constant name="struts.multipart.saveDir" value="location of your choice" />
    ...
</struts>

PS:Your acceptance rate seems low/not defined.In order to get help its always advised to accept answer if it helps you to solve your problem

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM