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

Coraz

Thanks :)
martin

This would do:

TransferOptions transferOptions = new TransferOptions();

transferOptions.FileMask = "*.doc;*.docs";
session.GetFiles("/remote/path/*", @"c:\local\path\", false, transferOptions).Check();
Coraz

I think C# would be better, but correct me if I'm mistaken, I'm just a beginner after all.
martin

Re: Select only specific-format files in subfolders, then download them

So what language are you coding this in? C# or PowerShell?
Coraz

Select only specific-format files in subfolders, then download them

First I'd like to say that it's the first time I'm trying to create a script, and I'm not a native English speaker, so learning a programming language like C# can be difficult for me.

What I'm trying to do is choose a directory (that much I can manage on my own), list all the files in the folder and the subfolders in the format .doc or .docx, then download them without regards to folder structure (I just want the files, not the folders). I figured after a bit of search that I would need .NET Assembly Line to accomplish this. Looking a bit around in this forum I found https://winscp.net/forum/viewtopic.php?t=14392, but I can't figure out a way to insert a filemask (or where to put it) and the pass the list output to the .NET equivalent of
mget
(I think I need to use this).

Could someone help me?