FTPGetFile behaviour?

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
rullbandspelare
Pro Scripter
Posts: 149
Joined: Tue Mar 23, 2004 9:11 pm

FTPGetFile behaviour?

Post by rullbandspelare » Tue Dec 02, 2008 12:19 pm

I am trying to retrieve files from a ftp server. This worked with FileZilla server but not this one. So it would be of interest on how FTPGetFile works?
when retrieving multiple files will MS do a "mget *" or "get filename1", get filename2" etc?

This is what happends when I ftp via XP cmd window.

Code: Select all

ftp> ls
200 Command okay.
150 Opening data connection.
.
..
bin
dev
etc
lib
mnt
tmp
sys
var
usr
proc
sbin
root
.var.tar
linuxrc
.dev.tar
226 Transfer complete.
ftp: 99 bytes received in 0,05Seconds 2,11Kbytes/sec.
ftp> mget *
No such file or directory.
200 Command okay.
ftp> get linuxrc
200 Command okay.
150 Opening data connection.
226 Transfer complete.
ftp: 1834 bytes received in 0,00Seconds 1834000,00Kbytes/sec.

When i do
FTPGetDirList>%IP%,%User%,%Password%,21,result.txt,/,L
This gives result.txt as the same as "ls" above

But then:
FTPGetFile>%IP%,%user%,%passwd%,21,c:\linuxrc,/linuxrc,I
gives
FTP_RESULT=550 Not a directory.

I have tried a lot of variations but cant get this to work with MS.

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Tue Dec 02, 2008 12:52 pm

It gets each matching file in turn. If linuxrc is a directory then you'd want to do something like:

FTPGetFile>%IP%,%user%,%passwd%,21,c:\linuxrc,/linuxrc/*.*,I

Or in v11 it would need to be:

FTPGetFile>%IP%,%user%,%passwd%,21,c:\linuxrc,/linuxrc,*.*,I

Assuming paths are all correct.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts