Win a copy of Succeeding with AI this week in the Artificial Intelligence and Machine Learning forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Junilu Lacar
Sheriffs:
  • Tim Cooke
  • Jeanne Boyarsky
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • fred rosenberger
  • Frits Walraven

File transfer to another IP using JSP

 
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...
 
Author and all-around good cowpoke
Posts: 13078
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
Posts: 13078
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..
 
Sheriff
Posts: 67389
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • 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 ...
 
I guess everyone has an angle. Fine, what do you want? Just know that you cannot have this tiny ad:
Two software engineers solve most of the world's problems in one K&R sized book
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic