Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

If you login with WinSCP GUI (or any other FTP client) on the same machine as you run your code, can you see a directory listing?
sraptis

Thank you for your help.

One correction at my previous message.
The error was at the rename function not at the upload. My mistake
Dim sessionOptions As New SessionOptions
With sessionOptions
    .Protocol = Protocol.Ftp
    .HostName = HostName
    .PortNumber = Port
    .UserName = ftpUsername
    .Password = ftpPassword
    If ftpUsePassive Then
        .FtpMode = FtpMode.Passive
    Else
        .FtpMode = FtpMode.Active
    End If
End With
Using session As New Session
    ' Connect
    session.SessionLogPath = "scp_rename.txt"
    session.Open(sessionOptions)
    session.MoveFile(mFromFile, mToFile)
End Using

I am attaching the log file.
The error message that I am getting is:
Lost connection.
Timeout detected. (control connection)
Could not retrieve file information
Can't get attributes of file 'FrVessel/tmprry-....
martin

Re: Lost connection. Timeout detected. (control connection)

Please attach a full session log file showing the problem (using the latest version of WinSCP).

To generate the session log file, set Session.SessionLogPath. Submit the log with your post as an attachment. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you can mark the attachment as private.
sraptis

Lost connection. Timeout detected. (control connection)

Hi,

I am trying the .NET assembly under VB .NET.
While when using the application it self I can transfer files without error, when I use this simple code:
Dim sessionOptions As New SessionOptions
With sessionOptions
    .Protocol = Protocol.Ftp
    .HostName = HostName
    .PortNumber = Port
    .UserName = ftpUsername
    .Password = ftppassword
    .FtpMode = FtpMode.Passive
End With
Using session As New Session
    ' Connect
    session.Open(sessionOptions)
    ' Upload files
    Dim transferOptions As New TransferOptions
    transferOptions.TransferMode = TransferMode.Binary
    transferOptions.OverwriteMode = OverwriteMode.Overwrite
 
    Dim transferResult As TransferOperationResult
    transferResult = session.PutFiles(mFromFile, mToFile, False, transferOptions)
    transferResult.Check()
End Using

I am getting the error message:
Lost connection.
Timeout detected. (control connection)
Could not retrieve file information
Can't get attributes of file ......

I want to add that the file has been transferred OK, but I get this message.

Any clues?
Stavros