On Mon, 18 Oct 2004 06:27:18 -0700 (PDT), Caroline Jen
<[EMAIL PROTECTED]> wrote:
> Now, I have this situation: While the web application
> is running, I need a place to store an uploaded file
> temporarily and then write this file out.
>
> Where is the proper place to create a directory to
> store a temporary file?
>
The servlet container will have already created a temporary directory
for you ... one option would be to use that one:
File tempDir = (File)
getServletContext().getAttribute("javax.servlet.context.tempdir");
File tempFile = new File(tempDir, "myfilename.tmp");
(Documented in section SRV.3.7.1 in the servlet spec.)
Craig
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]