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

jrichardw

Ah!!! Okay...good catch! Thanks!!


martin wrote:

It's the comma in the file name. In file masks, the comma is a mask separator. If you want to use it literally, you have to double it:

-filemask="Underwriting_mmcisoedi16488000_Correspondence_CORR_20170504_Cotterman & Company,, Inc. A & M Real Estate,, LLC Red Conncection, LLC Cotterman & Cotterman,, Inc.______________C_Submission_M_mmcisoedi33388621_.pdf|*/"

See https://winscp.net/eng/docs/file_mask#combining
martin

It's the comma in the file name. In file masks, the comma is a mask separator. If you want to use it literally, you have to double it:

-filemask="Underwriting_mmcisoedi16488000_Correspondence_CORR_20170504_Cotterman & Company,, Inc. A & M Real Estate,, LLC Red Conncection, LLC Cotterman & Cotterman,, Inc.______________C_Submission_M_mmcisoedi33388621_.pdf|*/"

See https://winscp.net/eng/docs/file_mask#combining
jrichardw

martin wrote:

Thanks. But we also need to know the name of the file to look for.


Hi Martin...any update on this?
jrichardw

I've attached two screenshots of two of the files that will not transfer. If you look in the log, only one of the PDF files will transfer. You can ignore the test.txt files...they are ones that I created just to test out my code logic.

The filemask will indicate that the file that should be transferring but as you'll see for all but one file,it excludes them from the transfer and skips the file.
martin

Thanks. But we also need to know the name of the file to look for.
jrichardw

I've uploaded and marked it private. I think that should suffice.
martin

Re: GetFiles with FileMask is skipping files

Sorry, but we need the log.
jrichardw

GetFiles with FileMask is skipping files

Hi, I'm using the following PS code to recursively download files. The files are mostly pdf files except for txt files that I create for testing. There is one file that will copy no matter what I use: I can use FileZilla or any other FTP client and I get a 550 permission denied on it. However, PS does not throw any sort of exception. The IsSuccess shows success, and of course the file doesn't copy. The session log doesn't show 550 or any other error; it just shows that it is skipping the file. That's the first issue.

The second issue is even on other files, that I can manually copy, my log shows that it is skipping the file. I'm trying to avoid attaching the log because the data is extremely sensitive data. The filenames contain names to my client's other customers. I would have to do a lot of redacting to attach a log file.

Any ideas on what is happening?

$transferOptions.FileMask = $f.FullName + $excludeDir               

$transfer = $session.GetFiles($getFiles, $localPath, $false, $transferOptions).Check()