08-04-2012, 02:30 PM
How can I download a file from FTP with wildcard in the filename? There is always only one file to download and its name is different every day.
So far macro below identifies correct filename but how to download it?
Ftp f.Connect("xxx.xxx.xxx.xxx" "username" "password" 0 0 1)
;If need, change current ftp directory to the directory where the file is
if(!f.DirSet("/")) end "failed to set FTP current directory"
ARRAY(STRINT) a
f.DirAll("*" a 2)
int i
for i 0 a.len
,out "%s%s" a[i].s iif(a[i].i " (folder)" "")
;Download to dir
f.SetProgressDialog(1)
if(!f.FileGet("?" "C:\Store\filename.gz")) end "failed to download"
mes "Completed!"
So far macro below identifies correct filename but how to download it?
Ftp f.Connect("xxx.xxx.xxx.xxx" "username" "password" 0 0 1)
;If need, change current ftp directory to the directory where the file is
if(!f.DirSet("/")) end "failed to set FTP current directory"
ARRAY(STRINT) a
f.DirAll("*" a 2)
int i
for i 0 a.len
,out "%s%s" a[i].s iif(a[i].i " (folder)" "")
;Download to dir
f.SetProgressDialog(1)
if(!f.FileGet("?" "C:\Store\filename.gz")) end "failed to download"
mes "Completed!"