curl-users
ftp issue with curl 7.18.1
Date: Tue, 22 Jul 2008 15:42:23 +1000
For some unknown reason, I am having an issue using curl to ftp.
I set up my PC as an ftp server for testing, and I had curl running
perfectly using 7.18.1, and using localhost as the ftp server.
My problem began when I tried to ftp from another machine. I keep getting:
% Total % Received % Xferd Average Speed Time Time Time
Current
Dload Upload Total Spent Left
Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:--
0
curl: (25) Failed FTP upload: 426
This created the file that I requested, but at 0 bytes. This confused me.
I then tried to manually ftp, using the standard ftp command supplied (both
are windows boxes - one Vista, the other Windows server 2003 R2). The
manual ftp worked perfectly. This told me that there was nothing wrong with
the ftp server settings.
Further digging into the logs (on the server) showed that my successful
transaction looked like:
04:02:16 xxx.xxx.xxx.xxx [21]USER xxxxxxx 331 0
04:02:16 xxx.xxx.xxx.xxx [21]PASS - 230 0
04:02:16 xxx.xxx.xxx.xxx [21]created /file.xml 226 0
04:02:16 xxx.xxx.xxx.xxx [21]QUIT - 226 0
My unsuccessful transaction looked like:
04:02:16 xxx.xxx.xxx.xxx [20]USER xxxxxxx 331 0
04:02:16 xxx.xxx.xxx.xxx [20]PASS - 230 0
04:02:16 xxx.xxx.xxx.xxx [20]created file.xml 426 995
04:02:16 xxx.xxx.xxx.xxx [20]QUIT - 426 0
The differences here that I can see is that the port number is different as
well as the '/' on the front of the file name in the successful transaction.
I am not sure how to rectify these differences.
Further to this, I also tried the curl command with verbose on to try and
diagnose the problem. The results are:
C:\>curl -v -T C:\file.xml -u user:secret ftp://xxx.xxx.xxx.xxx//file.xml
* About to connect() to xxx.xxx.xxx.xxx port 21 (#0)
* Trying xxx.xxx.xxx.xxx... connected
* Connected to xxx.xxx.xxx.xxx (xxx.xxx.xxx.xxx) port 21 (#0)
< 220 Microsoft FTP Service
> USER user
< 331 Password required for user.
> PASS secret
< 230 User user logged in.
> PWD
< 257 "/" is current directory.
* Entry path is '/'
> EPSV
* Connect data stream passively
< 500 'EPSV': command not understood
* disabling EPSV usage
> PASV
< 227 Entering Passive Mode (xxx,xxx,xxx,xxx,31,207).
* Trying xxx.xxx.xxx.xxx... connected
* Connecting to xxx.xxx.xxx.xxx (xxx.xxx.xxx.xxx) port 8143
> TYPE I
< 200 Type set to I.
> STOR andrew.xml
< 426 Connection closed; transfer aborted.
* Failed FTP upload: 426
* Remembering we are in dir "/"
* Uploaded unaligned file size (0 out of 7804 bytes)
% Total % Received % Xferd Average Speed Time Time Time
Current
Dload Upload Total Spent Left
Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:--
0*
Connection #0 to host xxx.xxx.xxx.xxx left intact
curl: (25) Failed FTP upload: 426
> QUIT
< 221
* Closing connection #0
I can't figure out why using the ftp command will work, but using curl
fails. Could somebody please help me out? Cheers.
Regards,
Andrew
-------------------------------------------------------------------
List admin: http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2008-07-22