ftp issue

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
kpassaur
Automation Wizard
Posts: 696
Joined: Wed Jul 07, 2004 1:55 pm

ftp issue

Post by kpassaur » Fri Apr 01, 2022 3:20 pm

I have been using a script for years and occasionally it has issues. The script goes to an ftp site and downloads a simple text file. The script no longer works are all and I am at a loss. The lines are:

Let>FTP_STATUS=1
Let>FTP_PASSIVE=1

DeleteFile>%TEMP_DIR%keys.txt
FTPGetFile>ftp.edocfile.com,kmpassaur,**********,21,%TEMP_DIR%keys.txt,/kpassaur/keys/,keys.txt,A

Naturally the ************ are the password.

As you can see here these are the settings in filezilla and they work. So I have to be missing something.
Image

Any ideas?

User avatar
JRL
Automation Wizard
Posts: 3497
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Re: ftp issue

Post by JRL » Fri Apr 01, 2022 6:24 pm

A little longer than yours.
Using DOS rather than Macro Scheduler functions for the FTP.
I use this twice a day every day and I've never had an issue.

Code: Select all

DeleteFile>%temp_dir%DownloadFTP.bat
DeleteFile>%temp_Dir%NewFTP.txt

Let>vSite=ftp.edocfile.com
Let>vFTPPath=/kpassaur/keys/
Let>vFile=keys.txt
Let>vUser=kmpassaur
Let>vPass=YourPassword
Let>vLocalPath=temp_dir

//Added for you.  I save my files to newly created folders and never delete them
DeleteFile>%vLocalPath%\%vFile%

LabelToVar>BatchFile,vBat
LabelToVar>FTPFile,vFTP
WriteLn>%temp_dir%DownloadFTP.bat,wres,vBat
WriteLn>%temp_Dir%NewFTP.txt,wres,vFTP

/*
BatchFile:
cd %vLocalPath%
ftp -i -s:%temp%\newFTP.txt
*/

/*
FTPFile:
open %vSite%
%vUser%
%vPass%
cd %vFTPPath%
binary
mget %vFile%
disconnect
quit
*/

Let>RP_Wait=1

//Not have to see the command window change windowmode to 0
//and cmd /k to cmd /c
Let>RP_Windowmode=1
RunProgram>cmd /k %temp_Dir%DownloadFTP.bat

MDL>complete

kpassaur
Automation Wizard
Posts: 696
Joined: Wed Jul 07, 2004 1:55 pm

Re: ftp issue

Post by kpassaur » Sun Apr 10, 2022 8:20 pm

Thanks JRL, but it didn't work. I found a couple of errors (I think) but it still did not work. One was the path you added for me it has a backslash in it."DeleteFile>%vLocalPath%\%vFile%"

The next was it is a text file so I changed it to ascii instead of binary

This is what is returned in the dos window

C:\Users\Keith Passaur\Desktop>cd C:\Users\KEITHP~1\AppData\Local\Temp\

C:\Users\KEITHP~1\AppData\Local\Temp>ftp -i -s:C:\Users\KEITHP~1\AppData\Local\Temp\newFTP.txt
ftp> open ftp.edocfile.com
Connected to edocfile.com.
220 Microsoft FTP Service
200 OPTS UTF8 command successful - UTF8 encoding now ON.
User (edocfile.com:(none)):
331 Password required

230 User logged in.
ftp> cd /kpassaur/keys/
250 CWD command successful.
ftp> ascii
200 Type set to A.
ftp> get keys.txt
200 PORT command successful.
150 Opening ASCII mode data connection.


Then it just hangs up

Any ideas? do you want me to email you the password?

I am so sick of this I am changing hosting companies to try to resolve it.

User avatar
JRL
Automation Wizard
Posts: 3497
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Re: ftp issue

Post by JRL » Mon Apr 11, 2022 11:00 am

Then it just hangs up
Is that more or less what happens when using your original code? From the info you sent it looks like you got logged in ok. you changed directories ok. It fails the moment the download begins.

For giggles see if Binary works.

I don't see an image in your original post but I'm assuming you are stating that the download works manually.

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