Resuming uploads

Top  Previous  Next

If a file fails to upload completely you can resume the upload using any of the Sftp#resumeUpload methods.  Prior to using the Sftp#resumeUpload method you must first determine how much of the file in bytes was successfully uploaded.  To do this you may use the Sftp#getFilesize method which will return the length of the remote file in bytes.

 

Example

 

// get length of remote file

long offset = sftp.getFilesize("setup.zip");

 

// resume file upload starting from offset

sftp.resumeUpload(new File("c:/setup.zip"),offset);

 

Note

 

Resuming uploads is only possible when transferring files in binary mode.  Resuming a transfer in ASCII mode is not supported.

 





Home | Company | Products | Solutions | Purchase | Support | Services | Blog

© 2021 JSCAPE LLC