Home Forums .NET libraries Xceed SFTP/FTP for .NET xcedd ftp tries to delete files in remote folder ?

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

    Hi, 

    with this single command
    source.CopyFilesTo(destination, True, True, fileMask)

    Xceed
    1. uploads sucessfuly the file to FTP
    2. logs out
    3. logs in again and tries to delete the file uploaded

    check the log below. why? Thank You

    (001058) 19-11-2008 11:22:23 – John (x.x.x.x)> PASV
    (001058) 19-11-2008 11:22:23 – John (x.x.x.x)> 227 Entering Passive Mode (y.y.y.y,0,20)
    (001058) 19-11-2008 11:22:23 – John (x.x.x.x)> STOR 20081119.zip
    (001058) 19-11-2008 11:22:23 – John (x.x.x.x)> 150 Connection accepted
    (001058) 19-11-2008 11:24:13 – John (x.x.x.x)> 226 Transfer OK
    (001058) 19-11-2008 11:24:13 – John (x.x.x.x)> disconnected.
    (001059) 19-11-2008 11:24:43 – (not logged in) (x.x.x.x)> Connected, sending welcome message…
    […]
    (001059) 19-11-2008 11:24:43 – (not logged in) (x.x.x.x)> USER John
    (001059) 19-11-2008 11:24:43 – (not logged in) (x.x.x.x)> 331 Password required for John
    (001059) 19-11-2008 11:24:43 – (not logged in) (x.x.x.x)> PASS ***********
    (001059) 19-11-2008 11:24:43 – John (x.x.x.x)> 230 Logged on
    (001059) 19-11-2008 11:24:43 – John (x.x.x.x)> CWD /BackFolder/MyFiles
    (001059) 19-11-2008 11:24:43 – John (x.x.x.x)> 250 CWD successful. “/BackFolder/MyFiles” is current directory.
    (001059) 19-11-2008 11:24:43 – John (x.x.x.x)> DELE 20081119.zip
    (001059) 19-11-2008 11:24:43 – John (x.x.x.x)> 550 Permission denied
    (001059) 19-11-2008 11:24:44 – John (x.x.x.x)> disconnected.

    Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by JohnZ (had 3748 views)

    User (Old forums)
    Member
    Post count: 23064

    Do you have a sample application reproducing the issue?

    Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by André (had 339 views)

    User (Old forums)
    Member
    Post count: 23064

    The problem is:

    we have an internal application. The application compresses (ZIP) some files (bds backups, windows backup files – bkfs) and then connects (code below) to a remote FTP and sends the zip file.

    the strange thing is:

    this single line
    source.CopyFilesTo(destination, True, True, “myzip.zip”)
    – sometimes, sends sucessfuly the ZIP file, disconnects from the server then… connects again and deletes the ZIP file
    – sometimes  sends sucessfuly the ZIP file and the file is NOT deleted

    but I allways get this error

    Erro no FTP : An unexpected internal failure occurred in the FileSystem component, or one of its descendants.
    Type: Xceed.FileSystem.DiskFolder
    FullName: C:\Data\Documents
    C:\Data\Documents is the sourceFolder containing the ZIP file – “myzip.zip”
    thank you

    Dim connection As FtpConnection
    connection = New FtpConnection(_ftpServer, 21, _userName, _password)

    Dim PassiveFtp As Boolean = True
    connection.PassiveTransfer = PassiveFtp
    Dim source As New DiskFolder(sourceFolder)

    Dim remoteFolder As String = “”
    remoteFolder = _remoteFolder

    Dim destination As New FtpFolder(connection, remoteFolder)
    source.CopyFilesTo(destination, True, True, “myzip.zip”)

    connection.CloseConnections()
    connection.Dispose()

    Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by JohnZ (had 680 views)

    User (Old forums)
    Member
    Post count: 23064

    This is because you are using the FileSystem interface (FtpConnection).  What happens is that when making a CopyTo(), if an exception is thrown inside that call, the component will call Delete() on the destination file to avoid leaving an incomplete file lying around. This is why you’re seeing a delete command on your server.

    Now, the problem is why are you getting an exception on your source folder?

    Could you paste the complete exception message and stack trace here?  And if there is an inner exception, could you also paste its complete message and stack trace?

     

    Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by André (had 3961 views)

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