2011-09-04 99 views

回答

10

你能告诉你正在使用的,将永远是有用的代码。 你需要在任何struts.xml的文件作为常数项指定

struts.multipart.saveDir= 

财产,或者你需要指定在struts.properties文件的选择都是你的。

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. 

这是因为你还没有自己指定的位置,这样的struts2正在加快进行文件上传的临时位置与您的文章的情况。

这里是struts.xml

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

PS 定义细节 File Upload

编辑链接:你的录取率似乎较低/不defined.In为了得到帮助其始终建议接受答案,如果它可以帮助你解决你的问题

+0

Thankyou Umesh回答,但我没有得到如何把这个代码在struts .xml – xrcwrn

+0

@Manish:查看我更新的帖子 –

+0

+1在struts.xml中显示它=) – Quaternion