Win a copy of TDD for a Shopping Website LiveProject this week in the Testing 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

File transfer to another IP using JSP

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 67636
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Fine. Thank you Bibeault ...
 
What's wrong? Where are you going? Stop! Read this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic