Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

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

supermankelly

Is there a way to only get the files and not the subfolders the files are in, which this does.

get * C:\local\folder\ -filemask=*.XML

So if I have on FTP...
/root/misc1/file1.xml

/root/misc1/file2.xml
/root/misc2/file3.xml
/root/misc3/file4.xml

I get back the subfolder structure where files are found...
C:\local\folder\misc1\file1.xml

C:\local\folder\misc1\file2.xml
C:\local\folder\misc2\file3.xml
C:\local\folder\misc3\file4.xml

I need, just the files...
C:\local\folder\file1.xml

C:\local\folder\file2.xml
C:\local\folder\file3.xml
C:\local\folder\file4.xml

Cheers!
martin

Re: get files from subfolders

It's
get * f:\files\Audit\XMLs\ -filemask=*.XML
feldman_c

Get files from subfolders

Hi There. New to WinSCP, and I'm struggling to do something that I believe should be simple. I want to login to my SFTP, go to a specific directory and pull files of XML type (*.XML) from all subfolders. When I run the following I get no files because the files are located in many different subfolders. If I do a cd and go directly to a subfolder I get my XML file within that specific subfolder. Not sure what I am missing here.

Thanks,
Craig

# Connect to the host and login using password
open sftp://username:pw@site.org
# Change the remote directory
cd /ecs-app/dcs/application/mainfolder
# get all the files in the remote directory and download them to a specific local directory
get *.XML f:\files\Audit\XMLs\