Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

File transfer to another IP using JSP

 
Jysh Reey
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13061
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13061
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64843
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As FTP has nothing to do with JSP, you'd be best off starting a new topic in the network protocols forum.
 
Jysh Reey
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Fine. Thank you Bibeault ...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic