cURL / Mailing Lists / curl-library / Single Mail


Re: how to define which protocal to use...

From: Daniel Stenberg <>
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:

> Btw. if I change the line
> curl_easy_setopt(curl, CURLOPT_URL, "");
> to
> curl_easy_setopt(curl, CURLOPT_URL, "");
> 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 --
Received on 2001-09-17