cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: curl: Remote file name has no length!

From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Mon, 4 Jul 2005 15:49:33 +0200 (CEST)

On Mon, 4 Jul 2005, Guillaume Fraysse wrote:

> I'm using libcurl (C) in an application

Then consider the curl-library mailing list instead!

> I'm getting a zero length buffer when I try to download the
> "http://www.slashdot.org" url and no error.

And what response headers do you get?

> I tried with the command line cURL on my debian box and I can't really
> understand what's going on :
> If I call it curl -O http://slashdot.org

> I get a curl: Remote file name has no length! Which seems to be likned with
> my problem.

Not really. -O attempts to figure out which local file name to use to store
the response as by extracting the file name part of the given URL, and since
your given URL lacks file name part -O cannot do what you ask of it.

This functionality is pure curl code and not something libcurl does or even
offers, so it can't be the problem you experience.

> I don't really understand why it doesn't work in the first case. And I dont
> see the right parameter to use in curl_easy_setopt to get the page.

Well, enable CURLOPT_VERBOSE and you very often figure it out. If not, show us
an example code (to the curl-library list) you use that doesn't work.

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2005-07-04