FTPGetFile Help

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
obfusc88
Pro Scripter
Posts: 89
Joined: Wed Mar 14, 2007 6:22 pm

FTPGetFile Help

Post by obfusc88 » Mon Jun 28, 2010 10:33 pm

Having trouble making an FTP download.

Result Code is "-". Using Macro Scheduler 11.1.20
==========================================
FTPGetFile prompts in the Editor don't match the Help syntax. Which one is correct? I guess the Editor since the code builder only shows six values also?

Help file syntax, 8 parameters:
FTPGetFile>Server,Username,Password,port,Local_Path,Host_Dir,Host_Filespec,Mode

Editor prompt syntax, 6 parameters:
FTPGetFile>Server Name/Address,Username,Password,Port Number,Local File,Host

Using six parameters. I can use FTPGetDirList OK, it shows all 63 files.

Also, what are the values for FTP_RESULT?
What does "-" mean, I suspect it is a failure.
What other values might I see, not noted in Help file. I did see "Success" when I did GetDirList.

adroege
Automation Wizard
Posts: 438
Joined: Tue Dec 07, 2004 7:39 pm

Post by adroege » Tue Jun 29, 2010 12:20 am

FTPGetFile>ftp.mjtnet.com,anonymous,[email protected],21,%WIN_DIR%\_msver.txt,/pub/msver.txt,A
This example from the help file in version 10 worked for me. I believe the FTP_RESULT is going to depend upon what "flavor" of FTP server you are connecting to - they are not all the same.

Depending upon the FTP server you are connecting to, you might need to enable Passive mode i.e.
If passive mode is required, set FTP_PASSIVE to 1.

obfusc88
Pro Scripter
Posts: 89
Joined: Wed Mar 14, 2007 6:22 pm

Post by obfusc88 » Tue Jun 29, 2010 2:49 am

adroege wrote:
FTPGetFile>ftp.mjtnet.com,anonymous,[email protected],21,%WIN_DIR%\_msver.txt,/pub/msver.txt,A
Strange, this example looks like it has SEVEN parameters.
Passive Mode is not the answer.

Thanks for the ideas....

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 Jun 29, 2010 8:31 am

FTPGetFile requires 8 parameters in v11 and above, and my editor in v11 and v12 correctly shows this. When v11 was released FTPGetFile and FTPPutFile required that the remote directory and filename were separate parameters.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

obfusc88
Pro Scripter
Posts: 89
Joined: Wed Mar 14, 2007 6:22 pm

Post by obfusc88 » Wed Jun 30, 2010 12:39 am

Thank you for the info mtettmar.

It turns out that my Editor screen needed to be expanded.
This is what I saw:

Image

You can see that the last few parameters do not show, and there is not arrow to signify the need to scroll right or widen the window. My window was actually narrower and did not show the full HostDir and subsequent.

I will try using the 8 values, this should be OK.....

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