More FTP help..

Associate
Joined
8 Mar 2007
Posts
2,176
Location
between here and there
evening all,

First all, a big thanks to the guys who helped me with my FTP issue earlier today.

Right, down to the nitty gritty...

I'm running a batch file with this inside..

Code:
@echo off
echo. >> log.txt
ftp -s:ftpscript.ftp ftp.myhost.com >> log.txt
echo. >> log.txt
pause
exit

This works fine, as in it connects to the server and runs the list of commands in the ftpscript.ftp file.

My problem is that the command's don't seem to match to what the log file shows happens.

contents of ftpscript.ftp
Code:
username
password
ascii
cd Data/customer
prompt n
mget *.*
bye


If I open a FTP connection in a sperate command prompt, and run though the commands listed in the ftpscript file, everything works perfectly. However when I run the batch file it fails.

Contents of log file
Code:
Connected to ftp.myhost.com.

220---------- Welcome  ----------
220-You are user number 3 of 50 allowed.
220-Local time is now 13:47. Server port: 21.
220 You will be disconnected after 15 minutes of inactivity.
User (ftp.myhost.com:(none)): 
331 User username OK. Password required

230-User username has group access to:  username
230 OK. Current restricted directory is /
ftp> ascii
200 TYPE is now ASCII
ftp> cd Data/customer
250 OK. Current directory is /Data/customer
ftp> Interactive mode Off .

ftp> prompt n
mget *.*
Syntax error in IP address

200 TYPE is now ASCII
ftp> bye
221-Goodbye. You uploaded 0 and downloaded 0 kbytes.
221 Logout.
 
---------------------------------

Can anyone shed any light on the subject??

Cheers in advance
 
Last edited:
I'm now getting an "No data connection error" and a "Syntax error in IP address"

I've googled both and found people are having issue when behind a firewall. I've open my FTP ports on both my router a XP firewall but i'm getting the same results.

It seems odd, that I can manually type in the commands and they work but yet having the script input them for me makes it fail.

I've really got to get this working tonight, and tbh I was hoping for an early one!!! ;)
 
Hi Blast

Have a go with my WGet Method from Yesterday - I am doing the same thing as you and using WGet works a treat.
Will save you a lot of hassle, and give you an early night!!! ;)

Rob
 
Back
Top Bottom