Upload multiples files
It's possible to upload multiples files in a only session?
Can you code for see?
Thanks
Ángel
Advertisement
Advertisement
Session.PutFiles
for each of your files.
Session.PutFileToDirectory
, which is more convenient to use.
Advertisement
Session.SynchronizeDirectories
to have WinSCP automatically upload all new and changed files:
synchronizationResult.Check()
statement to ignore the errors? It turns out that when it finds an open file, it gives an error and stops uploading even if we control the error with a try catch block
Advertisement
TransferOptions.FileMask
:
Advertisement
I do not know what you mean. What "versions"? Please elaborate.Is it possible to keep multiple file versions in directory sync?
See https://winscp.net/eng/docs/faq_script_non_recursiveIs it possible to sync a directory and not internal directories to sync?
In other words, synchronization is not recursive
See https://winscp.net/eng/docs/file_mask#size_timeHow can I make a mask so that it saves the files from a certain date and that it does not go through the subdirectories.
Advertisement
PutFiles
function (to record a directory using the mask property "*. *;> 2020-05-01 | * /"
I always get the same error, I attach my code
Error transferring file 'C: \\ projects \\ test.txt.txt'. \ R \ nCopying files to remote side failed. \ R \ nFilename invalid"}
string LocalDirectory = currentDir + @ "\ *"; TransferOperationResult transferResult; transferResult = session.PutFiles (LocalDirectory, RemoteName, false, transferOptions);
You can append a timestamp to the destination filename.A file is modified on Monday, Tuesday and Wednesday. I would like to know how it can be done to have the three versions in the remote directory.
Sorry that's too broad/vague. We do not know anything about format/structure of your files.We will be able to implement a differential or incremental copy system.
How can I make "FileMask" contain a non-recursive option and make the date greater than or equal to a given date.
>=2020-05-15|*/
Advertisement
Please attach a full session log file showing the problem (using the latest version of WinSCP).Hello, when I use thePutFiles
function (to record a directory using the mask property"*. *;> 2020-05-01 | * /"
I always get the same error, I attach my code
Session.SessionLogPath
. Submit the log with your post as an attachment. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you can mark the attachment as private.Advertisement
Advertisement
You can post new topics in this forum