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

Darren

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!
martin

Re: FTPS resume via PoSH - not working

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).
Darren

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