Topic "GUI works, .NET assembly (PoSh) times out"

Author Message
edutton
[View user's profile]

Joined: 2016-10-28
Posts: 1
Location: NC
Hi,
I have searched the forum and other sites, and tried a few things that were suggested, but I can't shake this problem. When I use the GUI tool, my SFTP uploads work fine, but when I call the .NET assembly from my Powershell script it always times out in the middle of the upload... (the test file I've been using is 708 Kb).

I have matched the settings in the script to those in the GUI as closely as possible, and already tried the suggestion found here of setting SendBuf to 0. I am attaching my script, and logs from both the GUI and the script. Any ideas or insights will be greatly appreciated!

Many thanks,
Erik
Temp.zip (16.87 KB) [Download]

Description: PoSh script, logs from GUI and script

martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26299
Location: Prague, Czechia
The SessionOptions.Timeout is of type TimeSpan.
In PowerShell, if you assign a numeric value to a TimeSpan, it coverts to "ticks". 1 tick = 1/10000000 second. You effectively set zero timeout.
You may want to use SessionOptions.TimeoutInMilliseconds = 15000.

Or have WinSCP generate the code for you:
https://winscp.net/eng/docs/ui_generateurl#code
Guest




Changing to TimeoutInMilliseconds seems to have resolved the issue in my test script, I will update the prod script and wait for the next scheduled run to confirm. Thank you!
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License