+1 vote

We are testing the Ftp.dll at the moment.

Everything is working fine, except resuming an upload when interrupted.

Do you have some example code for resuming FTP upload?

Kind regards,
Christian

by

1 Answer

0 votes
 
Best answer

If your server supports REST extension (check if Ftp.Extensions contains FtpExtension.RestExtension), you simply use Ftp.Upload method overload:

public void Upload(
        string remotePath,
        long remoteStartPosition,
        Stream source
)

As you can see, you need to set the remoteStartPosition parameter.

To know the parameter value, just ask the server
for the size of the uploaded file using Ftp.GetFileSize method.

Remember to seek the source stream (set Stream.Position) to appropriate value before resuming upload.

by (301k points)
...