• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

To Save a file in a different location

 
Steph Sam
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 20669
65
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Upload to what? A web server? Running JSP / servlets, or what?
 
Anutosh Swamy
Ranch Hand
Posts: 30
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Steph Sam
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi thanks for your reply. I need to upload the image from the user's machine to the server
 
Campbell Ritchie
Sheriff
Pie
Posts: 50277
80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 30
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic