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]

Reply via email to