It's not a secret anymore!*
The moose likes Struts and the fly likes Storing Files Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Storing Files" Watch "Storing Files" New topic
Author

Storing Files

Patrick McDonogh
Ranch Hand

Joined: Oct 13, 2005
Posts: 89
Hi there,

I have a Struts web site where users can upload files to the server hosting the site.
These files can then be downloaded by other users.

I was wondering if anyone knows the best way to store the files on the file system?
For instance is it better to store them all in one directory or multiple directories?

Does anyone know if there are any articles which would explain the best way to store and retrieve these files.

Thanks for the help.

Patrick
ameya n
Greenhorn

Joined: May 14, 2007
Posts: 17
you can store it in database as blob ......but am not sure of the best practice
Amirtharaj Chinnaraj
Ranch Hand

Joined: Sep 28, 2006
Posts: 236
hi Patrick McDonogh

you can use struts formFile for file uploading

and you can use BufferedinputStream(for the file content) for downloading

that uploaded file content

regards
amir
Chris Boldon
Ranch Hand

Joined: Aug 10, 2006
Posts: 190
Store it in the DB
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Storing Files