Topic "Filemasks with Spaces"

Author Message



I am having problems with spaces in my file mask, I have tried these three different ways around it, and none of them get to what I want, which is to exclude the /To Client/ Directory, and download the rest of the files.

$transferResult = $session.GetFiles($directory.fullname, $full_filepath_to, $False, $transferOptions)

$transferOptions.FileMask = "*.*>200D | */To Client/, */landing_zone/, *.pdf"
$transferOptions.FileMask = ">200D | */To Client/, */landing_zone/, *.pdf"
Both give:
. 2017-02-16 16:00:00.405 file.txt;-;20763893;2017-02-16T20:39:40.000Z;3;"" [0];"" [0];rwxrwxrwx;1
. 2017-02-16 16:00:00.405 Copying 1 files/directories to local directory "C:\landing_zone\"
. 2017-02-16 16:00:00.405 PrTime: Yes; PrRO: No; Rght: rw-r--r--; PrR: No (No); FnCs: N; RIC: 0100; Resume: S (102400); CalcS: No; Mask: enrollment_2017022.txt
. 2017-02-16 16:00:00.405 TM: B; ClAr: No; RemEOF: No; RemBOM: No; CPS: 0; NewerOnly: No; InclM: "*.* | */To Client/, */landing_zone/, *.pdf"; ResumeL: 0
. 2017-02-16 16:00:00.405 AscM: *.*html; *.htm; *.txt; *.php; *.php3; *.cgi; *.c; *.cpp; *.h; *.pas; *.bas; *.tex; *.pl; *.js; .htaccess; *.xtml; *.css; *.cfg; *.ini; *.sh; *.xml
. 2017-02-16 16:00:00.405 File "/file.txt" excluded from transfer

$transferOptions.Filemask = >200D | */To Client/, */landing_zone/, *.pdf
This allows all files in, and does not mask the /To Client/ directory

Any help on this would be grateful.
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25748
Location: Prague, Czechia
Your (first and second) syntax seems correct (works for me).

Please attach a full session log file showing the problem (using the latest version of WinSCP).

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!


About donations

$9   $19   $49   $99

About donations


WinSCP Privacy Policy

WinSCP License