Trying to upload an entire directory structure in one hit

Advertisement

SirClickalot
Donor
Joined:
Posts:
4
Location:
UK

Trying to upload an entire directory structure in one hit

I have WinSCP working nicely at the command line (Windows 11) for single files in the 'current' directory- (i.e. the directory in which the batch file is located) directory using...
"C:\Program Files (x86)\WinSCP\WinSCP.com" ^
  /log="C:\my-dir\WinSCP.log" /ini=nul ^
  /command ^
    "open ftp://username:password@host/ -rawsettings CacheDirectories=0 CacheDirectoryChanges=0" ^
    "put *.pdf /public_html/assets/PDF/" ^
    "exit"
But, what I really need is for ALL pdf files (and only pdf files) in the current directory AND all those in subdirectories PLUS I need the subdirectory structure to be honoured and created on the remote if they don't already exist.

Is that actually possible? – maybe I'm missing a simple switch but I cannot find it in the documentation.

Many thanks everyone
Nick

Reply with quote

Advertisement

SirClickalot
Donor

Replacing spaces in paths and leaf filenames

Is it anyway possible to replace all SPACES (%20) in the original path/filename with dashes (-)?
I have a had another read through the documentation but I cannot see anything obvious 'though there is a mention of 'replace' but I don't quite understand it.
Thank you

Reply with quote

martin
Site Admin
martin avatar

Re: Replacing spaces in paths and leaf filenames

No there's no such built-in replacement functionality for uploads.

It's no difficult to implement this though with use of some advanced scripting language (like PowerShell) and WinSCP .NET assembly.

Reply with quote

Advertisement

You can post new topics in this forum