Topic "FTPS resume via PoSH - not working"

Author Message
Darren
[View user's profile]

Joined: 2015-06-11
Posts: 2
Location: MA
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:

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
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
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
[View user's profile]

Joined: 2015-06-11
Posts: 2
Location: MA
prikryl 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!
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