This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes To Save a file in a different location Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "To Save a file in a different location" Watch "To Save a file in a different location" New topic
Author

To Save a file in a different location

Steph Sam
Greenhorn

Joined: Dec 09, 2007
Posts: 15
Hi All,

In my project i have a requirement. The user will upload any kind of image. The image has to be stored in a different location. How can i do it? I'm able to browse and select the image using html. But how to read the file and store it in a different location?
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19655
    
  18

Upload to what? A web server? Running JSP / servlets, or what?


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Anutosh Swamy
Ranch Hand

Joined: Sep 20, 2007
Posts: 30

Hope this code will help you to upload any file type to any location
you need to modify the the code according to your project.




K.Anutosh
---------------------------------------------------------------------------
SCJP 1.4
SCWCD 1.4
OCA (Paper I)

[edit]Add code tags. CR[/edit]
[ October 13, 2008: Message edited by: Campbell Ritchie ]

K. Anutosh<br /> <br />SCJP 1.4<br />SCWCD 1.4<br />OCA (Paper I)
Steph Sam
Greenhorn

Joined: Dec 09, 2007
Posts: 15
hi thanks for your reply. I need to upload the image from the user's machine to the server
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38044
    
  22
And please use the code button, Anutosh Swamy; I have added the tags so you can see how much better the posting looks.

CR
Anutosh Swamy
Ranch Hand

Joined: Sep 20, 2007
Posts: 30

Hi Campbell Ritchie,

Thanks for correcting my mistake, this will be surly taken care of in future.
[ October 20, 2008: Message edited by: Anutosh Swamy ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: To Save a file in a different location
 
Similar Threads
Create Image object
Frames in XML
renaming image
read and display an Image
how does JSP get an image created from a servlet ?