by default the uploaded files may be saved to the JVM's directory, in your case this sounds like: "C:\WINNT\SYSTE32\".
You can get your Web Applications directory from the HttpServletRequest. I think the method is called getRealPath() and has been depreciated and moved somewhere else ServletContext maybe.
With regard to overwritting files, your approach sounds good. Alternatively you could prepend files with the users name and/or sequence number.
Regards Malcolm
From: Eric Everman <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: [Tapestry-developer] Upload Component (new thread)
Date: Mon, 04 Nov 2002 11:00:33 -0600
[I had previously posted these questions, but had buried them under a discussion of component documentation]
Using the Upload Component, I noticed that uploaded files are stashed in "C:\WINNT\SYSTE32\". Is there a way to control where the files are uploaded to? A better default would be to respect the servlet's javax.servlet.context.tempdir attribute. Also, is there a way to specify a max file size?
I looked thru the code for net.sf.tapestry.form.Upload and net.sf.tapestry.multipart.UploadPart, but could not find the actual code that determines where files are uploaded to. Can someone point me in the right direction?
One other concern: if all files are uploaded to the same directory, wouldn't it be possible for multiple clients to overwrite each others files during upload? Imagine dozens of people uploading their resume on a busy site - chances are good that you would get a collision on the name 'resume.doc'. The approach I've taken in other projects is to create a unique directory for each file uploaded -- suggestions?
Thanks,
Eric Everman
-------------------------------------------------------
This SF.net email is sponsored by: ApacheCon, November 18-21 in
Las Vegas (supported by COMDEX), the only Apache event to be
fully supported by the ASF. http://www.apachecon.com
_______________________________________________
Tapestry-developer mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/tapestry-developer
_________________________________________________________________
Surf the Web without missing calls!�Get MSN Broadband. http://resourcecenter.msn.com/access/plans/freeactivation.asp
-------------------------------------------------------
This SF.net email is sponsored by: ApacheCon, November 18-21 in
Las Vegas (supported by COMDEX), the only Apache event to be
fully supported by the ASF. http://www.apachecon.com
_______________________________________________
Tapestry-developer mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/tapestry-developer
