Home Forums .NET libraries Xceed SFTP/FTP for .NET Cancel a file download?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #21321 |

    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)

                connection.Dispose()

            End If 

    __________________________________________________

    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)

    Xceed Support
    Member
    Post count: 5658

    Hi,

    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:

    http://doc.xceedsoft.com/products/XceedFileSystem/Xceed.Ftp~Xceed.Ftp.FtpClient~Abort.html

    Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by Alain [Xceed] (had 1288 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.