Community discussion forum

How to do Pause and resume file while uplaoding on ftp server

  • 1 year ago

    Hi ,

      I am developing ftp client application using c#.net. I done uplaoding file but i want to pause that file  while uplaoding and again resume that pause file.Is there any method avilble to pause and resume file.

    Is any one having idea about this how can i do this.

     

  • 1 year ago

    The FTP protocol does not have a "pause" function.  The way you would accomplish this is as follows:

    1.  Cancel the upload by canceling the write process (this assumes you are writing data to server in chunks e.g. 1024 byte chunks).

    2.  Get size  of remote file partially uploaded.  This can be done using the SIZE [filename] command and will return the partial file upload size.

    3.  Send REST [offset] command to, where [offset] is the length of partial file upload.

    4.  Send STOR [filename] command as you would using normal file upload.  

    5.  Send data for [filename] starting with [offset].

    For an API that does this for you, check out the following FTP .NET API.  The method you want to use is Ftp.ResumeUpload

     

     

     

     

     

Post a reply

Enter your message below

Sign in or Join us (it's free).

Want to stay in touch with what's going on? Follow us on twitter!