Resuming upload

Top  Previous  Next

Resumes the upload of the file to the FTP server.

 

Context:

 

You have a big file and when you tried to upload this file, the transfer failed. Now you have the 50% file on the server, but you need upload the rest of the file. You can use ResumeUpload method to do this, automatically resume the upload from the point of failure.

 

[C#]

// create new Ftp instance

Ftp ftp = new Ftp(hostname,username,password,port);                        

 

// establish connection

ftp.Connect();

 

// create new System.IO.FileInfo instance

FileInfo fileInfo = new FileInfo( "C:\\FileToUpload.txt" );

 

// resumes the upload of the file to the FTP server.

ftp.ResumeUpload(fileInfo);

 

// disconnect

ftp.Disconnect();

 

 

 

[Visual Basic]

' create new Ftp instance

Dim ftp As Ftp = New Ftp(hostname, username, password, port)

 

' establish connection

ftp.Connect()

 

' create new System.IO.FileInfo instance

Dim fileInfo As FileInfo = New FileInfo("C:\FileToUpload.txt")

 

' resumes the upload of the file to the FTP server.

ftp.ResumeUpload(fileInfo);

 

' disconnect

ftp.Disconnect()