This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Struts and the fly likes Uploaded File Location?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Uploaded File Location??" Watch "Uploaded File Location??" New topic
Author

Uploaded File Location??

Pallavi ch
Ranch Hand

Joined: Dec 16, 2004
Posts: 75
Hi all ,
I've uploaded a file to the server using struts - FormFile.
I'm able to get the file name and size in the server side.

but how do I know where it is saved on the disk??
I mean the file location?

OR

How do I save a uploaded file to a particular location??
alan wamser
Ranch Hand

Joined: Jan 30, 2006
Posts: 41
It's not saved to disk automatically, that's something that you'll have to do. Once you have the file you can write it to disk or even to a database. I've used the FormFile to upload a file from a form then used Hibernate to write the file to an Oracle database.

Look at the api, you'll see that FormFile has a method getInputStream...
Pallavi ch
Ranch Hand

Joined: Dec 16, 2004
Posts: 75
Thanks.
It worked for me.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Uploaded File Location??
 
It's not a secret anymore!