FTPS resume via PoSH - not working

Advertisement

Darren
Joined:
Posts:
2
Location:
MA

FTPS resume via PoSH - not working

I'm attempting to test the "resume" functionality of FTPS via the .NET assembly by doing the following:

Starting an upload, and then midway through, killing the WinSCP process and disposing of the Session. This leaves a file with the correct name, but obviously the wrong size. At this point, I assume that starting a new put will resume the transfer, but the file starts over from zero. I'm using the following code:

    Add-Type -Path "WinSCPnet.dll"
    $sessionOptions = New-Object WinSCP.SessionOptions
    $sessionOptions.Protocol = [WinSCP.Protocol]::Ftp
    $sessionOptions.HostName = $HostIP
    $sessionOptions.UserName = $UserName
    $sessionOptions.PortNumber = $HostPort
    $sessionOptions.FtpSecure = "ExplicitSsl"
    $sessionOptions.TlsHostCertificateFingerprint = $TlsKey
    $sessionOptions.SecurePassword = $SecurePassword
 
    $session = New-Object WinSCP.Session
    $session.DebugLogPath = ".\ftpdebug.txt"
    $session.SessionLogPath = ".\ftpsession.txt"

    $session.Open($sessionOptions)
    $transferOptions = New-Object WinSCP.TransferOptions
    $transferOptions.TransferMode = [WinSCP.TransferMode]::Binary
    $transferOptions.ResumeSupport.State = [WinSCP.TransferResumeSupportState]::On
 
    $transferResult = $session.PutFiles($TestUploadFile, "/", $False, $transferOptions)

Am I making a poor assumption? Missing something in my code? Both?

Thanks in advance for any assistance,
Darren

Reply with quote

Darren
Joined:
Posts:
2
Location:
MA

Re: FTPS resume via PoSH - not working

martin wrote:

The "automatic resume" is supported with SFTP protocol only:
https://winscp.net/eng/docs/resume#automatic

And the .NET assembly does not support "manual resume" yet (an equivalent of scripting -resume flag).

Ah, then that makes sense as to why it's not working. Thanks for the quick response!

Reply with quote

Advertisement

You can post new topics in this forum