Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Re: Can the localPath in PutFiles() point to a remote filepath?

Ok, I see. Unfortunately, there's no good way now.
wildview

Re: Can the localPath in PutFiles() point to a remote filepath?

Thanks, but I don't want to duplicate a file on our SFTP, actually I'm trying to append to a current file on the SFTP remote server, that's why was trying to use the the PutFiles since the PutFile method w/ the transferOptions.OverwriteMode = OverwriteMode.Append, appears to be broken in the WinSCP latest build, it just overwrites the current file no matter what the transferOptions.OverwriteMode is set to even in SFTP mode. See the other ticket I have posted below. I can read in a file, append the data and write it back out, but that get's slow as the file grows, so I'd like to append w/ the PutFile() if it worked properly, is there anyway to resolve that problem? If not, I might have to look at using a another SFTP client that supports this functionality which I'd prefer not to if possible since everything else works fine. Let me know.

OverwriteMode.Append using PutFile on an SFTP server, doesn't appear to work
martin

Re: Can the localPath in PutFiles() point to a remote filepath?

The Session.PutFiles is for uploading "local" files to a remote directory.

If you want to copy a remote file to another remote directory, use Session.DuplicateFile:
https://winscp.net/eng/docs/library_session_duplicatefile
wildview

Can the localPath in PutFiles() point to a remote filepath?

Can the localPath in PutFiles() point to a remote SFTP filepath? Trying to append a .tmp file on the remote SFTP path to the same remote path w/ a different filename (see below). For some reason, it throws an error saying it can't find the file on the localPath, when it's clearly there. I think this should work. Any help would be greatly appreciated. Tnx.
localPath= "/Users/sftpuser/test.tmp"
remotePath= "/Users/sftpuser/test.csv"