aspose file tools*
The moose likes JSP and the fly likes File transfer to another IP using JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "File transfer to another IP using JSP" Watch "File transfer to another IP using JSP" New topic
Author

File transfer to another IP using JSP

Jysh Reey
Greenhorn

Joined: Oct 10, 2011
Posts: 16
My task is to upload a file and save it to another system when the IP address and path were specified... Am using JSP language.. Till now I am able to save a file in my local system at a specified location..But I have got no clue how to save it to another system.. Help me..

Thanks in advance...
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12823
    
    5
You have to have a cooperating process on the other system of course. Think of the security problem otherwise!

You need to find out what the other system has available - FTP is commonly used for file transfer.

Bill
Jysh Reey
Greenhorn

Joined: Oct 10, 2011
Posts: 16
My task is to upload a file to a server connected through LAN.

Client IP - x.x.x.a
Server IP - x.x.x.b

The file gets uploaded in server's mysql database succesfully. But I want it in a folder in server instead. I'm confused how to specify the destination path then. Except that part the code works well.
(Ppl whoever tries to execute the code dnt forget to include JAR file for mysql while executing)

Hearty thanks in advance for quick assistance.
Here is the code.

William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12823
    
    5
File ff = new File("Destintion Path" + saveFile);

// What should be the path ("Destination Path") specification above
//for storing the file in server x.x.x.b


You simply can not do this - think what a security hole if you could arbitrarily address files on another IP address.

I say again - "You need to find out what the other system has available - FTP is commonly used for file transfer."

This will involve cooperating with the other system's security provisions.

Bill
Jysh Reey
Greenhorn

Joined: Oct 10, 2011
Posts: 16
Thank you william.

Am new to ftp. I came across few examples for transferring files using ftp and Java. I have a doubt how to set ftp username and password for the server. I searched in net but cant find exactly what I am looking for. Help me please.


Thanks in advance..
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61654
    
  67

As FTP has nothing to do with JSP, you'd be best off starting a new topic in the network protocols forum.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Jysh Reey
Greenhorn

Joined: Oct 10, 2011
Posts: 16
Fine. Thank you Bibeault ...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: File transfer to another IP using JSP