cURL / Mailing Lists / curl-users / Single Mail

curl-users

Active FTP issue

From: Matthew Pettis <matthew.pettis_at_gmail.com>
Date: Mon, 12 Apr 2010 09:58:15 -0500

Hi,

I'm attempting to have curl download a file from an ftp site that only
allows active ftp. I get curl to work on my home windows os with a dsl
connection, but not on my cloud image (which has a fixed ip). the form i'm
using is:

curl --url "ftp://ftpsite/file" --user theuser:thepassword -P 21 -v

here's the result:

However, when i just use regular 'ftp', i can download the file just fine
from my cloud image. I can write a batch ftp script, but i'd rather use
curl (because doggone it, I just like it). Any ideas?

==== Curl on server that doesn't work ====

matt@myserver:~$ curl --url "ftp://ftp.xxx.xxx.xx.xx/Cntytbl.txt" --user
xxxxxxxx:xxxxxxxx -P 21 -v
* About to connect() to ftp.sos.state.mn.us port 21 (#0)
* Trying xxx.98.17.18... connected
* Connected to ftp.xxx.xxx.xx.xx (xxx.98.17.18) port 21 (#0)
< 220 Microsoft FTP Service
> USER media
< 331 Password required for xxxxxxxx.
> PASS results
< 230 User xxxxxxxx logged in.
> PWD
< 257 "/media" is current directory.
* Entry path is '/media'
> EPRT |1|0.0.0.21|58293|
< 200 PORT command successful.
* Connect data stream actively
> TYPE I
< 200 Type set to I.
> SIZE Cntytbl.txt
< 213 1347
> RETR Cntytbl.txt
< 150 Opening BINARY mode data connection for Cntytbl.txt(1347 bytes).
* Timeout while waiting for server connect
* Remembering we are in dir ""
* Connection #0 to host ftp.xxx.xxx.xx.xx left intact
curl: (30) Timeout while waiting for server connect
> QUIT
< 425 Can't open data connection.
* Closing connection #0

==== Standard ftp on same server ====

matt_at_myserver:~$ ftp -v ftp.xxx.xxx.xx.xx
Connected to ftp.xxx.xxx.xx.xx.
220 Microsoft FTP Service
Name (ftp.xxx.xxx.xx.xx:matt): xxxxxxxx
331 Password required for media.
Password:
230 User xxxxxxxx logged in.
Remote system type is Windows_NT.
ftp> get Cntytbl.txt
local: Cntytbl.txt remote: Cntytbl.txt
200 PORT command successful.
150 Opening ASCII mode data connection for Cntytbl.txt(1347 bytes).
226 Transfer complete.
1347 bytes received in 0.00 secs (328.9 kB/s)
ftp> bye
221

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-04-12