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

Guest

I think I solved the problem. It was on server side, due to automatic transfer resume.

"With SFTP protocol, when automatic transfer resume is enabled, WinSCP first uploads the file to a temporary file with .filepart extension. Only after the transfer is completed the file is renamed to its actual name."

I've deactivated this, and I live the VBA code here, for future uses:

TransferOptions.ResumeSupport.State = TransferResumeSupportState.TransferResumeSupportState_Off

Thanks, Martin, for all your help.
EviluSH

hi martin,

mail sent.

Thanks.
martin

Thanks for your report.

Can you send me an email, so I can send you back a debug version of WinSCP to track the problem? Please include link back to this topic in your email. Also note in this topic that you have sent the email. Thanks.

You will find my address (if you log in) in my forum profile.
Guest

Added. Thanks.
martin

Re: VBA --- Timeout waiting for WinSCP to respond

Try to run just a simple script file like:

winscp.com /log=session.log /ini=nul /script=script.txt

with script.txt:

open "sftp://user@xx.xxx.xxx.xx" -hostkey="*" -privatekey="C:/xxxx/PrivateKey.ppk" -timeout=600

put  -nopermissions -preservetime -transfer="binary" -- "\\xxxx\*" "/in/"


What does it do? Post a log file.
Guest

Hi,

Added logs + debug for both cases OK & NOK.
Thanks,
martin

Re: VBA --- Timeout waiting for WinSCP to respond

We need corresponding debug log files too. See my previous post.
Guest

And a log when it had only 84 files to transfer, and, of course, it worked.
Guest

Hi, I generated a log today, when it failed, having to upload 287 files.
martin

Re: VBA --- Timeout waiting for WinSCP to respond

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

To generate the log files, set Session.SessionLogPath and Session.DebugLogPath. Submit the logs with your post as an attachment. You may want to remove data you consider sensitive (unless they are relevant to the problem). If you do not want to post the log publicly, you can mark the attachment as private.
Guest

VBA --- Timeout waiting for WinSCP to respond

Hello,

I've implemented WinSCP .NET Assembly for VBA, trying to upload files from a local folder through SFTP, but I'm getting "Timeout waiting for WinSCP to respond" when I try to upload a number of files bigger than 150 - 200.
Of course, I've tried using .TimeoutInMilliseconds and I've increased it and tested even with 900000.

If I transfer only 100 files, it's ok with values much much lower than 900000. BTW, what is the MAX value for TimeoutInMilliseconds?
When I get the timeout error, it fails without transferring any file, so this makes me understand that it fails at the part when WinSCP evaluates the number of files & dimension it has to transfer, before starting the transfer.

The files are .zip and have in average 110 KB, so the transferred values are not so big, between 20MB-45MB per day.

With mySessionOptions
.Protocol = Protocol_Sftp
.TimeoutInMilliseconds = 600000
.HostName = "xx.xxx.xxx.xx"
.UserName = "xxxxx"
.GiveUpSecurityAndAcceptAnySshHostKey = True
.SshPrivateKeyPath = "C:/xxxx/PrivateKey.ppk"
End With

And the transfer is done like:

' Upload files
Dim myTransferOptions As New TransferOptions
myTransferOptions.TransferMode = TransferMode_Binary

Dim transferResult As TransferOperationResult
Set transferResult = mySession.PutFiles("\\local\path\*", "/in/", False, myTransferOptions)

Thanks in advance for your advices.