Topic ".NET assembly equivalent of -neweronly for PutFiles()?"

Author Message
Particle

Guest


Hello-

I've been experimenting with WinSCP for uploading to an FTPS file server. Using a script file, I can upload files and automatically resume or skip existing files as is appropriate using:

put <localpath> <remotepath> -resume -neweronly

However, I've been trying to replicate this behavior using the .NET assembly and have not found an equivalent to the -neweronly flag available in winscp.com. Neither the session options class nor transfer options class seems to have criteria for when to resume.

Is this feature available? Some files I'm uploading are hundreds of megabytes, so this could potentially consume a large amount of time for data which is already on the server.

Thanks,
Geoff
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
Use Session.SynchronizeDirectories:
https://winscp.net/eng/docs/library_session_synchronizedirectories
https://winscp.net/eng/docs/scriptcommand_put#net
Particle

Guest


As a script at least using winscp.com, synchronize doesn't seem to correctly resume or skip regardless of options set when using FTPS. I had started there but gave up using it when I found success with put. Does it behave differently here?
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
What does it mean "doesn't seem to correctly resume or skip"?
Particle

Guest


No combination of parameters caused the synchronize command to behave this way:

- Leave alone remote files not present locally
- Upload local files that do not exist remotely
- Resume remote files where the local copy is larger
- Skip remote files where the local copy is the same size

I tried many combinations and could sometimes satisfy a set of those requirements but never all.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
OK, use

session.AddRawConfiguration(@"Interface\CopyParam\NewerOnly", "1");

See https://winscp.net/eng/docs/rawconfig
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