cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Failed Writing Body

From: Mark Schienbein <mark_at_jurysystems.com>
Date: Thu, 22 Sep 2011 08:45:06 -0700

>
> > I am using the CURLOPT_PROXY_TRANSFER_MODE setting to insure a binary
file
> > transfer through the proxy. As documented, this adds the "type=i" to the
end
> > of the URL. Unfortunately, the "type=i" gets set as part of the file
name on
> > the FTP server, however it does insure that the complete file is
transfered.
>
> The sad reality is that FTP over a HTTP proxy like you're doing is not
> standardized anywhere and works more or less only chance and circumstance.
> What works and what doesn't work is impossible to forsee and it will
differ
> from proxy to proxy.
>
> Your problem doesn't make sense to me though, but perhaps I've
misunderstood
> it.
>
> If you need type=i to get sent in the URL for the proxy to ask for the
file in
> binary from the remote FTP server as otherwise you get the file wrongly.
>
> but...
>
> If you set type=i in the URL, then the proxy will send that as part of the
> file name it requests from the server?
>
> Did I misunderstand something?
>
Yes you misunderstood that I am not requesting a file from the remote FTP
server but instead I am uploading a file to it.
The "type=i" which automatically gets appended to the "PUT" command URL by
CURLlib (because of the CURLOPT_PROXY_TRANSFER_MODE setting) becomes part of
the uploaded filename on the FTP server. Using the
CURLOPT_PROXY_TRANSFER_MODE setting does produce a binary file transfer to
the remote server (the uploaded file is identical to the local source file).
Without the CURLOPT_PROXY_TRANSFER_MODE setting however, the file is
transferred in ASCII text mode and CRLF characters in the local source file
are only sent as LF characters.

It appears that with the CURLOPT_PROXY_TRANSFER_MODE option set, CURL is
setting the FTP option to binary (using the FTP binary command?) but then
also passes the ";type=i" clause to the FTP server which gets interpreted as
part of the file name. So my question is: Is their some way to get CURL to
indicate to the taget server to do a binary file transfer, but then not pass
the ";type=i" clause on the PUT command url?

> -------------------------------------------------------------------
> List admin: http://cool.haxx.se/list/listinfo/curl-library
> Etiquette: http://curl.haxx.se/mail/etiquette.html

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-09-22