1.

Solve : Syntax error in IP address?

Answer»

hey all,

Anyone know how to fix the dreaded "Syntax error in IP address" error while trying to "get" files off a ftp server??

I'm beating my head against a brick wall..... This isn't my specialty but I would go ahead and post your current code here.oh, FAQ mod eh??? been promated??

anyway, here's my code.

FTPfeed.bat

Code: [Select]@echo off

echo. >> c:\FTPfeed\log\log.txt
echo. >> c:\FTPfeed\log\log.txt

ftp -s:ftpscript.ftp -a ftp.myhost.com >> c:\FTPfeed\log\log.txt

echo. >> c:\FTPfeed\log\log.txt
echo --------------------------------- >> c:\FTPfeed\log\log.txt

pause

exit

And the ftpscript.ftp

Code: [Select]user
password
cd Data/customer
prompt
mget *.*
bye

As you can see my batch file outputs a log file,

Code: [Select]Connected to ftp.myhost.com.

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

230-User user has group access to: user
230 OK. Current restricted directory is /
ftp> cd Data/customer
250 OK. Current directory is /Data/customer
ftp> Interactive mode Off .

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

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


I've got no idea why this doesn't work.

If I open a command prompt, connect to the ftp site and manually run through the commands listed in my ftpscript.ftp file, everything works fine.

Help me please!!what happens if you LEAVE out the prompt command, i.e. allow the y prompt to show for each transfer?
if I remove the "prompt" I get "Syntax error IP address".

If I try and "get" one one file at a time I get a "Syntax error IP address" and "No Data CONNECTION" error.

I've been all througth the internet but found only suggestions that it's a fire wall issue. So i've disabled my windows firewall and allowed ports 20 and 21 through my router's firewall (NAT to my loacl IP address) but no luck.

I'm still getting this error.

Cheers for the reply.FIX!!

turns out I had to add a few extra switches...

ftp -v -n -i -d -s:ftpscript.ftp

All's good now!!-v suppresses display of remote server responses.
-n suppresses auto-login upon initial connection.
-i turns off interactive prompting during multiple file transfers.
-d ENABLES debugging.



Discussion

No Comment Found