Post a reply

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)


Topic review


Re: upload extremely slow

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

To generate 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.

i ended up using wininet.dll, it was faster.

upload extremely slow

I'm using winscp dll 5.5.6 and i find it extremely slow.

This statement takes over a minute to upload a small 3kb file.

FTPsession.PutFiles(Localpath, Remotepath, False, _transferoptions)

can you point to the issue please ?

here is my full code :
  Private Function Upload() As Boolean

        _Sessionoptions = New SessionOptions
            With _Sessionoptions
                .HostName = hostname
                .PortNumber = 21
                .UserName = login
                .Password = passwd
                .Protocol = Protocol.Ftp
            End With
        Catch ex As SessionException
            MsgBox(ex.Message, MsgBoxStyle.Critical)
        Catch ex As Exception
            MsgBox(ex.Message, MsgBoxStyle.Critical)
        End Try

        With _transferoptions
            .TransferMode = TransferMode.Automatic
            .PreserveTimestamp = False
        End With

        'open the session and transfer file
        Dim FTPsession As Session

            FTPsession = New Session

            'continuous progress reporting
            AddHandler FTPsession.FileTransferred, AddressOf FileTransferred
            Dim filepath As String = System.Reflection.Assembly.GetExecutingAssembly.Location
            ' Session.ExecutablePath =
            FTPsession.DisableVersionCheck = True
            _transferresult = FTPsession.PutFiles(Localpath, Remotepath, False, _transferoptions)
            _Sessionoptions = Nothing

            If _transferresult.IsSuccess = True Then
                Return True
                Errorlog = "Error in WinSCP "
                Return False
            End If

        Catch ex As Exception

            Errorlog = "Error in WinSCP : " & ex.Message.ToString
            Return False
            FTPsession = Nothing
        End Try

    End Function