Topic "Disable ResumeSupport in Powershell"

Author Message
Jstannard
[View user's profile]

Joined: 2016-02-08
Posts: 1
I am trying to write a file to an ftp server where I only have write access, not modify. I am having a problem because I get back

Cannot create remote file '/xxx.filepart'.

The documentation suggests this is because I do not have modify access. I did this WinSCP -> Preferences -> Endurance -> Disable
I checked the winscp.ini file and ResumeSupport = 2 ( I believe this means disabled). I ran "echo $transferOptions.ResumeSupport" and it says that it is in a default state.

I have checked this documentation:
https://winscp.net/eng/docs/ui_pref_resume
https://winscp.net/eng/docs/library_transferoptions#resumesupport

However, I don't see a powershell example, just C#.

I have tried various permutations of $transferOptions.ResumeSupport.State = Off, $transferOptions.ResumeSupport.Off, and whatnot. One of these says that it's read-only.

Thanks in advance for help,
Jay
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
My response to your duplicate post on Stack Overflow:
http://stackoverflow.com/q/35278404/850848

---

Syntax for using enumeration in PowerShell is described in
article Using WinSCP .NET assembly from PowerShell.

Quote:
Enumeration values are accessed using static field syntax [Namespace.Type]::Member, for example [WinSCP.Protocol]::Sftp.


---

You can find a PowerShell example for TransferResumeSupport.State in Converting to .NET assembly section of get and put command documentation:

Code:
$transferOptions = New-Object WinSCP.TransferOptions
$transferOptions.ResumeSupport.State = [WinSCP.TransferResumeSupportState]::Off
$session.GetFiles(..., ..., $False, $transferOptions).Check()
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