Post a reply

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

If the parameter can be folder or file, you just need to make the include mask accept both files and folders:

synchronize remote "C:\to_upload\" /Public -filemask="%1%;%1%\"
Pepper

Or, if I use put for uploading single files with switch -filemask for example:[m:e3e8791c78]
put -resume -transfer=automatic -filemask="|my_file.zip" "my_file.zip"[/m:e3e8791c78]

can be situation where local file will be newer than remote, and it not be uploaded, because file mask switch present.
Pepper

martin wrote:

Pepper wrote:

synchronize remote -filemask=filename - I can't use.

Why?

I use WinSCP in script mode.
I run it from batch: WinSCP.exe /console /script="C:\wscpcmd.txt" /parameter %prm%

wscpcmd.txt:[m:782fe1861a]
open ftp://... -passive=on -timeout=10 -rawsettings Utf=2
option batch on
option confirm off
option reconnecttime 20
synchronize remote "C:\to_upload\%1%" /Public
close
exit
[/m:782fe1861a]

where is %prm% can be single file or folder, and I don't know exists this file/folder at FTP or not.
If I upload folder to FTP - I don't know which files in this folder already exists, because I can't use -filemask.

(In this example sсript will be problem if %prm% contain single file name (not folder).)
martin

Pepper wrote:

synchronize remote -filemask=filename - I can't use.

Why?
Pepper

martin wrote:

You can do synchronize remote -filemask=filename to restrict synchronization to a single file.
https://winscp.net/eng/docs/scriptcommand_synchronize

There's also this outstanding request:
https://winscp.net/tracker/666


Thank you, for reply and outstanding request.
synchronize remote -filemask=filename - I can't use.
Awaiting we can solve this problem in the next release WinSCP?
Pepper

In other words, I need a command (or combination command/switches) like:
"synchronize remote"
but for files (not for folders)

Thanks!
Pepper

How use Put command for uploading only new files

Hi.

I wrote script which must upload some files to my FTP.
In which I use PUT command.

How I can say to PUT command don't upload the already existing files in remote directory?

Before WinSCP I excellent used ncftpput tool, but it don't understand russian utf-8 file names. And if I try upload same files of local and remote directory ncftpput say: "remote file appears to be the same as the local file, upload is not necessary." - is what I need.

But WinSCP in this case still upload files - do unnecessary work.

(Sorry for my English.)