Thanks a lot for all those replied by query. The reason why I want to set saveDir in my Java code is that as a developer, I would like to take everything under my own control but I suppose if the default upload saveDir, without externally setting it in struts.xml, works in all occasions, e.g. Windows, Linux, (I am not an expert here) then the existing arrangement of the saveDir arrangement is satisfactory.
Cheers, Qunhuan -----Original Message----- From: Dave Newton [mailto:newton.d...@yahoo.com] Sent: 04 June 2009 01:12 To: Struts Users Mailing List Subject: Re: About the "struts.multipart.saveDir" for file upload Qunhuan Mei wrote: > When implementing file upload, it is required to specify an absolute > directory in struts.xml such as following: > > <constant name="struts.multipart.saveDir" value="C:/fileUploadTempDir" /> > > But this might be difficult to achieve, say when the project war is deployed > in a external shared server and we do not have much idea about the directory > structure of the target server machine. The current, canonical way to handle file uploads is to copy them from the default upload directory to wherever you want them. It's not required to set the saveDir; it defaults to the default temporary directory. The file upload interceptor currently deletes the uploaded file after the action executes, which is why the copy is needed. Sounds like this will all be changing pretty quick-like, though. Dave --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org