upload extremely slow

Advertisement

gottfried91513
Joined:
Posts:
2

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
        Try
            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

        Try
            FTPsession = New Session

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

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

        Catch ex As Exception

            Errorlog = "Error in WinSCP : " & ex.Message.ToString
            MsgBox(Errorlog)
            Return False
        Finally
            FTPsession.Dispose()
            FTPsession = Nothing
        End Try

    End Function

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
28,262
Location:
Prague, Czechia

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.

_________________
Martin Prikryl

Reply with quote

Advertisement

You can post new topics in this forum