cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: url malformed error with simple curl usage

From: Kamil Dudka <kdudka_at_redhat.com>
Date: Sat, 20 Mar 2010 09:11:06 +0100

On Saturday 20 of March 2010 04:47:59 Scott Haneda wrote:
> That worked; downloaded the file to the current working directory and kept
> the file name. But what if I want to download the file to some other
> location?
>
> $curl http://www.google.com/intl/en_ALL/images/logo.gif -O ~/Desktop
> % Total % Received % Xferd Average Speed Time Time Time
> Current Dload Upload Total Spent Left Speed 100 8558 100 8558
> 0 0 62538 0 --:--:-- --:--:-- --:--:-- 146k curl: (3) <url>
> malformed

You just mixed it up. '-O' parses the file name from URL, thus take no extra
argument. Then the '~/Desktop' is treated as second URL. If you want to
specify the file name manulally, you want to use '-o', which takes an
argument.

Kamil
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-03-20