Help with multiple download of files with FTP
Moderators: Dorian (MJT support), JRL
-
- Newbie
- Posts: 6
- Joined: Sat Mar 17, 2007 11:38 pm
Help with multiple download of files with FTP
I want to be able to download multiple files from an ftp server, onto a computer without knowing the exact filenames(timestamps at the end).
I tried ftpGetFile>server,user,pass,port,localDir/*.*,remoteDir/*.*... didnt work.
any suggestions?
I tried ftpGetFile>server,user,pass,port,localDir/*.*,remoteDir/*.*... didnt work.
any suggestions?
The help file example says
FTPGetFile>Server,Username,Password,port,Local_Path,Host_Filespec,Mode
or
FTPGetFile>ftp.domain.com,anonymous,[email protected],21,c:\temp\,/pub/*.txt,A
In your provided example, you have Local_Path as "localDir/*.*" - I don't think you should have the *.* in there, and did you really mean "/" or "\" ?.
(The Local_Path can be a full "Dir\Filename.ext", but it would only really be good if you were planning to transfer one individual file and you wanted to save it with a different name).
You also have also not included a Mode.
"Mode can be either A or I, where A represents ASCII transfer mode and I represents binary."
Try changing your line to something more like;
ftpGetFile>server,user,pass,port,localDir\,remoteDir/*.*,I
You can check the output/result of "FTP_RESULT"...
MessageModal>%FTP_RESULT%
(This can quickly help you spot errors such as bad path, invalid login, etc).
FTPGetFile>Server,Username,Password,port,Local_Path,Host_Filespec,Mode
or
FTPGetFile>ftp.domain.com,anonymous,[email protected],21,c:\temp\,/pub/*.txt,A
In your provided example, you have Local_Path as "localDir/*.*" - I don't think you should have the *.* in there, and did you really mean "/" or "\" ?.
(The Local_Path can be a full "Dir\Filename.ext", but it would only really be good if you were planning to transfer one individual file and you wanted to save it with a different name).
You also have also not included a Mode.
"Mode can be either A or I, where A represents ASCII transfer mode and I represents binary."
Try changing your line to something more like;
ftpGetFile>server,user,pass,port,localDir\,remoteDir/*.*,I
You can check the output/result of "FTP_RESULT"...
MessageModal>%FTP_RESULT%
(This can quickly help you spot errors such as bad path, invalid login, etc).
-
- Newbie
- Posts: 6
- Joined: Sat Mar 17, 2007 11:38 pm
-
- Automation Wizard
- Posts: 1101
- Joined: Fri Jan 07, 2005 5:55 pm
- Location: Somewhere else on the planet
"localdir" and "remotedir" are examples intended to be replaced with real paths that exist on your system. Maybe this example is easier to understand:
FTPGetFile>ftp.domain.com,anonymous,[email protected],21,c:\temp\myfile.txt,/pub/readme.txt,A
FTPGetFile>ftp.domain.com,anonymous,[email protected],21,c:\temp\myfile.txt,/pub/readme.txt,A
-
- Newbie
- Posts: 6
- Joined: Sat Mar 17, 2007 11:38 pm
I assume you're running this program on a windows based system. Could it be that the entry should say "localDir" instead of "localDir/" ?web_developer wrote:i checked the %FTP_RESULT%, but it said that that it cant find the local file "localDir/"
Perhaps this may be easier if you post the actual "FTPGetFile" line that you're using. And other than user/password info - maybe also show us the lines such as Let>localDir=c:\blah\blah\
-
- Newbie
- Posts: 6
- Joined: Sat Mar 17, 2007 11:38 pm
Ok, I dont have access to the script right now, but this is the general idea:Captive wrote:I assume you're running this program on a windows based system. Could it be that the entry should say "localDir" instead of "localDir/" ?web_developer wrote:i checked the %FTP_RESULT%, but it said that that it cant find the local file "localDir/"
Perhaps this may be easier if you post the actual "FTPGetFile" line that you're using. And other than user/password info - maybe also show us the lines such as Let>localDir=c:\blah\blah\
let>localDir=C:\data\backup\Sun\
let>remoteDir=/data/backup/Sun/*.*
ftpGetFile>ftp.somesite.com,username,password,21,localDir,remoteDir,I
-
- Automation Wizard
- Posts: 1101
- Joined: Fri Jan 07, 2005 5:55 pm
- Location: Somewhere else on the planet
Thanks for the clarification. That scheme works perfectly for me. The localDir and remoteDir below are exactly how I entered them.
let>localDir=C:\ftptest\
let>remoteDir=/web/ftptest/*.*
ftpGetFile>ftp.mydomain.com,mylogin,mypassword,21,localDir,remoteDir,I
Grabbed 27 files / 4 megs with no problem.
What version of MacroScheduler are you using? Wildcard ftp is only supported in recent versions.
let>localDir=C:\ftptest\
let>remoteDir=/web/ftptest/*.*
ftpGetFile>ftp.mydomain.com,mylogin,mypassword,21,localDir,remoteDir,I
Grabbed 27 files / 4 megs with no problem.
What version of MacroScheduler are you using? Wildcard ftp is only supported in recent versions.