curl-library
Re: how to define which protocal to use...
From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 17 Sep 2001 12:10:06 +0200 (MET DST)
Date: Mon, 17 Sep 2001 12:10:06 +0200 (MET DST)
On Mon, 17 Sep 2001, Olli Aalto wrote:
> I have bit of a problem uploading a file to a ftp-server. It seems that
> curllib wants to use http protocol. How do I define which protocol to
> use.
By providing an FTP-style URL. In your case, it would be:
"ftp://fani.fidata.fi/README"
> Btw. if I change the line
> curl_easy_setopt(curl, CURLOPT_URL, "fani.fidata.fi:21/README");
> to
> curl_easy_setopt(curl, CURLOPT_URL, "fani.fidata.fi/README");
> I'll get error number 7, connection refused.
Yes, that's because if you don't provide the protocol part of the URL,
libcurl will "guess" what protocol you're interested in, and it defaults to
HTTP... So, then it tries port 80 on the machine.
-- Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/Received on 2001-09-17