cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Rename file on ftp server over proxy.

From: Michael Wood <esiotrot_at_gmail.com>
Date: Wed, 17 Mar 2010 18:10:34 +0200

2010/3/17 way sky <wayinsky_at_gmail.com>:
>
> 2010/3/17 Daniel Stenberg <daniel_at_haxx.se>
>>
>> Then something is really wrong. We have test cases that verify this
>> funcionality so the basic CONNECT stuff should work. Did you mention what
>> libcurl version and OS this is?
>
> I'm missing one thing. I dont saw first call of CONNECT. First call doing on
> 21 port and then is alredy going on random port. Tomorow I can post verbose.
> OS - WinXP SP3. libcurl - Version 7.20.0 (9 February 2010).
>
> I tried to change the source libcurl to call CONNECT only on port 21. Then
> the second CONNECT successfully passes. Work with FTP server comes to call
> the command:
> STOR file_name.ext. Then an error, the exact text, I have not got right now.
> As I understood the essence, FTP server tries to open a channel on a random
> port:
> 229 Entering Extended Passive Mode (| | | 14641 |).

Yes, this is the way FTP works. Active mode might work a little
better, but would require the server to connect back to the client.
Not sure if libcurl supports active mode anyway.

>> Well, you do need a file name to upload to, what else are you going to
>> name the remote file?
>
> I don't know... But I'm already try with CURLOPT_PREQUOTE and ftp command
> STOR :)

That won't work.

Maybe you can download the file via normal GET ftp://blah/path/to/file
to the proxy and then after that use CONNECT and QUOTE to remove the
file? That way you would not need port 20 or the random port because
there would be no data channel. Only a command channel.

-- 
Michael Wood <esiotrot_at_gmail.com>
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2010-03-17