aspose file tools*
The moose likes Servlets and the fly likes How to upload a file from local machine to remote machine Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "How to upload a file from local machine to remote machine" Watch "How to upload a file from local machine to remote machine" New topic
Author

How to upload a file from local machine to remote machine

karnakar ganji
Greenhorn

Joined: Jul 31, 2008
Posts: 12
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


Karnakar K Ganji<br />Keep Smiling
Schandha Ravi
Ranch Hand

Joined: Oct 20, 2007
Posts: 167
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)





Thanks & Regards, SK
SCJP 5.0, DB2 - 800, DB2 - 803, SCDJWS (On the way)
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61424
    
  67

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
karnakar ganji
Greenhorn

Joined: Jul 31, 2008
Posts: 12
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

Joined: Oct 08, 2006
Posts: 2458
Use Apache Commons FileUpload. This is also suggested in under each the JSP FAQ mentioned by Bear.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61424
    
  67

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

Joined: Oct 20, 2007
Posts: 167
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.
 
Consider Paul's rocket mass heater.
 
subject: How to upload a file from local machine to remote machine