The remote server returned an error: (503) Bad sequence of commands


  • I attempting to download 6 files from my FTP site to a local server using VB 2008.

    After 1 or 2 files are downloaded I am geeting an error Bad sequence of commands.

    It appears the ftp connection is not closing then re-opening.

    Here's what me code looks like:

     struri = ""
        strdestinationname = Me.TXTCompanyFolder.Text & "\TEST.exe"
        StrUserName = "xxxxx"
        StrPassWord = "xxxxxxxxx"
        Me.Cursor = Cursors.WaitCursor
        LBLFileName.Text = "File 2 of 6"
        My.Computer.Network.DownloadFile(struri, strdestinationname, StrUserName, StrPassWord, True, 100, True, FileIO.UICancelOption.ThrowException)

    Then I change the file name. After the 2nd or 3rd file, I get the error message.

    How would I close the connection and reopen it without having to close the program?

    Thank you

    Tuesday, May 11, 2010 2:26 PM

All replies