Topic "Powershell & transferresumesupport in .net/beta version"

Author Message
paolop
[View user's profile]

Joined: 2013-11-19
Posts: 2
Location: Far East
Hello,
maybe somebody will be so kind as to help me out.

I'm trying to run a PS script to upload (large) backup files to a Gluster node. It seems I can't turn off the creation of temporary files on the target, and this causes problems with Gluster locking/replicating the 'filepart' files.

Can anybody suggest what I might be doing wrong? (I'm not a scripting guy, please forgive stupid mistakes)

Here are the relevant lines in the script...

[Reflection.Assembly]::LoadFrom("c:\program files (x86)\winscp\WinSCPnet.dll") | Out-Null
$sessionOptions = New-Object WinSCP.SessionOptions
$sessionOptions.Protocol = [WinSCP.Protocol]::Sftp
...
$transferOptions = New-Object WinSCP.TransferOptions
$transferOptions.ResumeSupport.State = [WinSCP.TransferResumeSupportState]::Off
...
$session = New-Object WinSCP.Session
$session.Open($sessionOptions)
...
$transferResult = $session.PutFiles($fullfilename, $remotePath, $transferOptions)

I also tried setting TransferResumeSupportState to ::Smart and setting a Threshold of 10000000 (10 G), but it does not work either (is threshold a 16-bit integer or a 32-bit integer?)

Any idea what I am doing wrong?

Thanks!
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
paolop wrote:
$transferResult = $session.PutFiles($fullfilename, $remotePath, $transferOptions)

options is fourth parameter of Session.PutFiles, while you pass it to third parameter, what is remove.
https://winscp.net/eng/docs/library_session_putfiles
_________________
Martin Prikryl
paolop
[View user's profile]

Joined: 2013-11-19
Posts: 2
Location: Far East
...don't know what to say.... DHU! (you do not have a face palm emoticon)

Thanks....
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