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


Evert wrote:

Can you tell me what code I have to edit / delete so the downlaod starts directly?

Delete $session.add_FileTransferProgress( { FileTransferProgress($_) } ) .

If it does not help, post a new log file (for a code with that line deleted).

Thanks for your reply, I'm editing the code but there isn't any progress.

Can you tell me what code I have to edit / delete so the downlaod starts directly?

Kind regards, Evert

Re: Reply with logfiles

It's the add_FileTransferProgress.
To calculate an operation progress for you, WinSCP has to first determine size of all files to be transferred. You have to chose. If you want the progress, you will have to bear the initial delay.

Reply with logfiles

Hi Martin,

This reply contains one logfiles, from a session with both empty directories.

The other logfile I couldn't add, it can be downloaded from <invalid hyperlink removed by admin>

All sessions are done on a local WiFi network with the FTP server on a QNAP.

Best regards, Evert

Re: Waiting time before download starts

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.

Waiting time before download starts

Hi all,

I like to use WINSCP for sharing software with my colleagues, everybody the same files in the same directories and it's organized on a QNAP NAS.

The whole Powershell script is build and works good when there is less data (4GB) on the NAS, when there is more data on the NAS it takes a long time before the sync is starting, like WINSCP is comparing / indexing both locations.

I've searched the forum, can't figure out how to fix my script that the sync is starter much quicker.

Below is my script, anyone who has a suggestion?
Thanks a lot, Evert

# Load WinSCP .NET assembly
Add-Type -Path "WinSCPnet.dll"

function FileTransferProgress

Write-Progress `
-Activity "Download status" -Status ("{0:P0} Gedownload:" -f $e.OverallProgress) `
-PercentComplete ($e.OverallProgress * 100)
Write-Progress `
-Id 1 -Activity $e.FileName -Status ("{0:P0} Gedownload:" -f $e.FileProgress) `
-PercentComplete ($e.FileProgress * 100)

# Set up session options
$sessionOptions = New-Object WinSCP.SessionOptions -Property @{
Protocol = [WinSCP.Protocol]::FTP
HostName = "FTP SERVER"
PortNumber = 21
UserName = "USERNAME"
Password = "PASSWORD"
FtpSecure = [WinSCP.FtpSecure]::Explicit
TlsHostCertificateFingerprint = "2a:c7:b9:88:2a:d5:dd:ec:54:30:9b:3f:2b:87:25:a3:35:36:80:4e"
Timeout = new-timespan -minutes 5

$session = New-Object WinSCP.Session



# Will continuously report progress of transfer
$session.add_FileTransferProgress( { FileTransferProgress($_) } )

# Connect
# Download Files
$transferOptions = New-Object WinSCP.TransferOptions
$transferOptions.TransferMode = [WinSCP.TransferMode]::Binary

# Sync external to local
$synchronizationResult =
[WinSCP.SynchronizationMode]::Local, "C:\Team-Software", "/Team", $True,

# Downloadspeed
Write-Host "Downloaded file $remotePath to $localPath"
Write-Host ("Size {0:N0} KB, Time {1:hh\:mm\:ss}" -f $size, $duration)
Write-Host ("Speed {0:N0} KB/s" -f $speed)

# Throw on any error