Solved Using ncftp to recursively download a specific file type

August 7, 2012 at 02:31:53
Specs: Windows 7
Hello,

I'm writing a windows command line batch file, in which I need to retrieve only JPG files from an FTP server, while keeping the folder structure of the FTP.

ncftp works perfectly for this, as long as I download ALL files - not just JPG:

ncftpget -R -u %ftpuser% -p %ftppassword% %ftphost% %downloadpath% /

But if I want to filter only JPGs, by doing this:
ncftpget -R -u %ftpuser% -p %ftppassword% %ftphost% %downloadpath% /*.jpg
I only download the JPGs on the root - not the recursive.

Any ideas of what I'm doing wrong? I also tried the winscp command line with exactly the same behavior.

Many thanks for your response.

Blaise


See More: Using ncftp to recursively download a specific file type

Report •


✔ Best Answer
August 8, 2012 at 21:18:33
might try wget. I've used it many times, but not for ftp servers.
wget -r ftp://username:password@ftp.server.com/*

wget -r ftp://username:password@ftp.server.com/TARGET/*

I don't think *.jpg will work, so
If you download wget, consult the help, you might need:
--accept=jpg
option.



#1
August 7, 2012 at 04:16:10
It might help if we had ncftp.


====================================
Life is too important to be taken seriously.

M2


Report •

#2
Report •

#3
August 7, 2012 at 09:42:08
Sorry - I assumed that ncftp and winscp were industry standards for windows command line FTP...

Blaise


Report •

Related Solutions

#4
August 8, 2012 at 21:18:33
✔ Best Answer
might try wget. I've used it many times, but not for ftp servers.
wget -r ftp://username:password@ftp.server.com/*

wget -r ftp://username:password@ftp.server.com/TARGET/*

I don't think *.jpg will work, so
If you download wget, consult the help, you might need:
--accept=jpg
option.


Report •

#5
August 10, 2012 at 01:04:58
Thanks nbrane - exactly what I needed!

Report •


Ask Question