Have a trouble with FTPGetFile. Please help

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
jennylci
Newbie
Posts: 14
Joined: Wed May 08, 2013 11:16 pm

Have a trouble with FTPGetFile. Please help

Post by jennylci » Fri Jan 10, 2014 11:44 pm

Hi,

It's my first time to use FTPGetFile command. It looks pretty straightforward but I can't make it work. It doesn't give me error message. The status window showed it connected to the FTP server. But it doesn't download any file for me. I'm using Macroscheduler 11 and CoreFTP. BTW, since I was not sure if it is wildcard's problem, I tried to specify the file name in my command. It didn't work out either. Can someone please tell me what the issue is?

Here is my script.

Code: Select all

day>DD
month>MM
year>YYYY
FTPGetFile>scca.com,jzhu,123xd11,22,C:\PROD\,/jzhu/Prod/,*mailings_%YYYY%%MM%%DD%.ZIP,A

User avatar
CyberCitizen
Automation Wizard
Posts: 721
Joined: Sun Jun 20, 2004 7:06 am
Location: Adelaide, South Australia

Post by CyberCitizen » Sun Jan 12, 2014 8:22 am

First problem might be this.

Closed Port 22 is closed on scca.com.

Source: http://www.yougetsignal.com/tools/open-ports/

Also its not recommended that you post your username or password to your site.
FIREFIGHTER

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

Post by Marcus Tettmar » Mon Jan 13, 2014 2:58 pm

FTP is usually port 21.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

jennylci
Newbie
Posts: 14
Joined: Wed May 08, 2013 11:16 pm

Post by jennylci » Mon Jan 13, 2014 8:47 pm

Thank you for your help. I'm pretty sure the port is 22 not 21. That's the port I used when I connect to FTP Server manually. But I tested port 21 anyways. It even couldn't connect to it. Any other ideas?

jennylci
Newbie
Posts: 14
Joined: Wed May 08, 2013 11:16 pm

Post by jennylci » Mon Jan 13, 2014 9:54 pm

No worries. It's a fake username and password.

User avatar
CyberCitizen
Automation Wizard
Posts: 721
Joined: Sun Jun 20, 2004 7:06 am
Location: Adelaide, South Australia

Post by CyberCitizen » Mon Jan 13, 2014 11:52 pm

As in my first post both port 21 and 22 are not open ports on that host name.
FIREFIGHTER

jennylci
Newbie
Posts: 14
Joined: Wed May 08, 2013 11:16 pm

Post by jennylci » Mon Jan 13, 2014 11:56 pm

Oops, I'm sorry I forgot to mention that the hos name is fake too. Due to security issues of my company, I didn't use the real ones.

User avatar
CyberCitizen
Automation Wizard
Posts: 721
Joined: Sun Jun 20, 2004 7:06 am
Location: Adelaide, South Australia

Post by CyberCitizen » Tue Jan 14, 2014 3:09 am

Have you had a look at the sample FTP script?

Code: Select all

MessageModal>This macro will download the version file from the web site.  You will need to connect to the Internet first.  This macro demonstrates the use of FTPGetFile and ReadLn for reading text files.
Ask>Are you connected to the Internet?,ruconnected
If>ruconnected=NO,end

  FTPGetFile>ftp.mjtnet.com,anonymous,[email protected],21,%SCRIPT_DIR%\_msver.txt,/pub,msver.txt,A
  Let>msg=
  Let>kk=1

  Label>readfile
  ReadLn>%SCRIPT_DIR%\_msver.txt,kk,line
  If>line=##EOF##,doneread
    Let>msg=%msg%%line%
    Let>msg=%msg%%CRLF%
    Let>kk=kk+1
    Goto>readfile
  Label>doneread

  MessageModal>%msg% %CRLF%This version is %MSCHED_VER%

Label>end
FTPGetFile>scca.com,jzhu,123xd11,22,C:\PROD\TEST.txt,/jzhu/Prod/,mailings_%YYYY%%MM%%DD%.ZIP,A
FIREFIGHTER

jennylci
Newbie
Posts: 14
Joined: Wed May 08, 2013 11:16 pm

Post by jennylci » Tue Jan 14, 2014 10:11 pm

Hi CyberCitizen,

I realize the connection is SFTP not FTP. Do you think it matters?

I specified the local file name as you indicated and changed my password format to [email protected]. At least it shows disconnecting in the status window now. But I still don't get any file using this command.

Thanks.
Jenny

User avatar
CyberCitizen
Automation Wizard
Posts: 721
Joined: Sun Jun 20, 2004 7:06 am
Location: Adelaide, South Australia

Post by CyberCitizen » Tue Jan 14, 2014 11:47 pm

Yes SFTP makes a huge difference as you need to flag it as a SFTP connection first.
You also need the open SSL libraries.

Macro Scheduler's FTP functions support TLS/SSL using the OpenSSL libraries. See the help file.
FIREFIGHTER

jennylci
Newbie
Posts: 14
Joined: Wed May 08, 2013 11:16 pm

Post by jennylci » Wed Jan 15, 2014 12:44 am

Thank you for your help. I will take a look.

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