Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to upload a file from local machine to remote machine

 
karnakar ganji
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI
can any one tell me that how to upload a file from local machine(c:\demo\demo.txt) to remote machine (suppose in remote directory i want to save that in \\172.43.23.12\demo\)

here i am facing a problem..in creating url..i have to create a url for uploading a file to remote location..so how do i create url and how do i save it in remote


thanks
 
Schandha Ravi
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'm not sure if are specifically looking for the file upload through Servlets. There are several options...

Most easy approach and my favorite
- FTP the file. No coding involved.

If you want to do it through your own program, then you can do it through file streaming and sockets (Which is going to be underlying logic no matter what you follow)



 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64609
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Schandha Ravi wrote: If you want to do it through your own program, then you can do it through file streaming and sockets (Which is going to be underlying logic no matter what you follow)
Seeing as this is posted in a Servlets forum, it is to be assumed that this is part of a web app in which case this is not the way to do it.

Please see the entry on file uploading in the JSP FAQ.
 
karnakar ganji
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
yes this file upload thing i want to do it through web application..
please help me out...

i know one thing..for uploading file into the remote we have to create a url.
..but i am confused..i can't get the demo for this in google also..

Thanks
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use Apache Commons FileUpload. This is also suggested in under each the JSP FAQ mentioned by Bear.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64609
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It helps if you actually read the responses:
Bear Bibeault wrote:Please see the entry on file uploading in the JSP FAQ.
 
Schandha Ravi
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:Seeing as this is posted in a Servlets forum, it is to be assumed that this is part of a web app in which case this is not the way to do it.

Please see the entry on file uploading in the JSP FAQ.


Thanks Bear. I went through this article before, but could not recollect it in time.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic