Generally I add a virtual directory to my web container. This allows you to map a context root to any directory on the server (keeping permissions in mind).
For example http://webroot/file would map to a directory /tmp/uploads. I proxy my web applications through Apache so I generally add an Alias entry to the virtual host. You will have to check your container's docs for your specific environment. -Shane -----Original Message----- From: Brian McSweeney [mailto:[EMAIL PROTECTED] Sent: Monday, August 18, 2003 10:47 AM To: 'Struts Users Mailing List' Subject: RE: file upload problem I would also love to know the solution to this problem. I'm doing the exact same thing as you Erez. Also working with JBoss_Tomcat. Is there some way to tell tomcat to serve files from a specific directory outside the context root? -----Original Message----- From: Erez Efrati [mailto:[EMAIL PROTECTED] Sent: 18 August 2003 16:33 To: 'Struts Users Mailing List' Subject: RE: file upload problem Thing is I do need a very high downloading of files, so I guess the directory option is more appropriate. What do you mean by "a directory served by your web server"? I am working with JBoss/Tomact and each time I am redeploy the any directory under the context is deleted. So is there a trick here that I missed ? Thanks, Erez -----Original Message----- From: Evan Schnell [mailto:[EMAIL PROTECTED] Sent: Monday, August 18, 2003 4:24 PM To: Struts Users Mailing List Subject: Re: file upload problem Erez Efrati wrote: >I am dealing as well with the file upload issue: > > > >2) I could always store those files in the database but then I would >have to access them through an action, is this wise? > > Yes. I'm a strong proponent of storage in a database. Not only is a BLOB the ultimate quarantine but it saves you the headache of keeping meta-data and and the file content in synch. Most RDBMs implement BLOBs as files so there is very little performance hit when you perform the upload. When users perform the download you will need an action to 'proxy' the bytes from the database to the response. If you write good java.io code, set the content type on the response and return null from the execute method this is pretty straightforward and fast enough for most applications. Downloads will be a little slower this way but it's rare for system requirements to necessitate repeated file download. If _each_ file is going to be downloaded more than a few hundred times/day you might want to write it to directory served by your _web_ server. Don't forget virus protection. If users can upload and download MS Office documents you will need to virus check them after they are uploaded but before anyone else can download them. Regards, Evan. -- Evan Schnell, Project Lead nVISIA, Twin Cities "Enterprise Architecture and Construction" http://www.nvisia.com 7701 France Ave. S, Edina, MN 55435 Voice: 952.837.2577 -- Fax: 952.837.2578 --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

