• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 241
  • Last Modified:

IMPORTANT: Need Java code to resume FTP transfers

I need the Java code for resuming FTP transfers urgently
0
ashish_me2
Asked:
ashish_me2
  • 5
  • 2
  • 2
1 Solution
 
objectsCommented:
upload or download?

0
 
ashish_me2Author Commented:
Both upload and download but I am currently interested in resuming the download
0
 
Venci75Commented:
     String host = "host";
      int port = 21;
      sun.net.ftp.FtpClient client = new sun.net.ftp.FtpClient(host, port);
      client.login("user", "pass");
      client.sendServer("REST 100");
      if (client.readServerResponse() != 350) {
          throw new IOException("Cannot restart");
      }
      client.get("file.dat"); // you can use also put
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
Venci75Commented:
sorry - should be:
client.sendServer("REST 100\n");
0
 
ashish_me2Author Commented:
Both upload and download but I am currently interested in resuming the download
0
 
objectsCommented:
Send following ftp commands:
REST <file offset>
STOR <filename>

*and* ensure you start sending the file bytes from the correct offset (or saving for the get).
0
 
ashish_me2Author Commented:
Both upload and download but I am currently interested in resuming the download
0
 
ashish_me2Author Commented:
Both upload and download but I am currently interested in resuming the download
0
 
ashish_me2Author Commented:
Both upload and download but I am currently interested in resuming the download
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 5
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now