Disable ResumeSupport when using .NET assembly in Powershell

Advertisement

meggenberger
Joined:
Posts:
1

Disable ResumeSupport when using .NET assembly in Powershell

Hi there.

I'm using WinSCP 5.0.7 from the Powershell. My script does various uploads/downloads renames etc. I encounter a problem when uploading files that some fail when it's trying to rename the file.filepart to the original name. When I use the GUI and I disable Preferences - Transfer - Endurance - Enable Transfer resume/transfer to temporary filename for
it works. As soon as I enable it most uploads fail. When I wait a bit (2-3 seconds) and then try a rename it works. I assume something on the SFTP server is preventing it from renaming it directly after the upload. Maybe a processing / scanning that locks the file for a short period of time. The SFTP server is out of my control so I tried to set the ResumeSupport Option also when using the .NET assembly with adding the following to my SessionOptions Object before opening the session:

...
$sessionOption.AddRawSettings("ResumeSupport","2")
...

But it's still creating xxx.filepart files first.

What am I doing wrong here to disable ResumeSupport? And when will Session.MoveFile be available? It says next release ... when would that be?

Regards,
Marc

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,517
Location:
Prague, Czechia

Re: Disable ResumeSupport when using .NET assembly in Powershell

meggenberger wrote:

$sessionOption.AddRawSettings("ResumeSupport","2")
ResumeSupport is not a session option, it is an global configuration option that cannot be set in NET assembly yet.

All you can do atm is to configure it in the GUI and unset Session.DefaultConfiguration
https://winscp.net/eng/docs/library_session

This request has been added to the tracker:
https://winscp.net/tracker/876

Reply with quote

Advertisement

You can post new topics in this forum