Home › Forums › .NET libraries › Xceed SFTP/FTP for .NET › Cancel a file download?
hi guys i need help with something please
so let say i have a button called download and then there is this code
If ListBox1.SelectedItem = “Test” Then
Button1.Enabled = False
Button3.Enabled = False
Dim starting As AbstractFolder = New FtpFolder(connection)
Dim destination As AbstractFolder = New DiskFolder(FolderBrowserDialog1.SelectedPath)
Dim sourcefile As AbstractFile = starting.GetFile(“test.txt”)
sourcefile.CopyTo(events, Nothing, destination, True)
and now i made a button called stop
and so when im dling the file above and i hit cancel
it will stop the connection and cancel the download
after that it will delete the file.
im using visual basic 2010 and i really need a code for it.
so please help me if you have any idea
thanks in advance
Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by home (had 1586 views)
Since you’re using the FileSystem interface (AbsractFolder.CopyTo()); there is no way to cancel an ftp download.
If you want that level of control, you’ll have to use the FtpClient or AsyncFtpClient interface. There’s an Abort() method:
Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by Alain [Xceed] (had 1288 views)