cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: download image without direct link

From: Ralph Mitchell <ralphmitchell_at_gmail.com>
Date: Sat, 9 Apr 2011 11:31:57 -0400

On Sat, Apr 9, 2011 at 5:50 AM, Dmitry ☻ <evermind_at_live.ru> wrote:

> Oh, it was needed to write "-O" in up case.
> But even with it file is loading corrupted.
>
> ./curl.exe -O "
> http://sat106.sat24.nl/h-image.ashx?region=eu&time=201104091000&ir=False"
> > "C:\temp\foo.gif"
> will save foo.gif in folder C:\temp\ with null size.
> But there would be another file in curl location (C:\curl\) named
> "h-image.ashx_region=eu&time=201104091000&ir=False" that's may be viewed if
> rename in to gif.
>

That's because the -O option tells curl to use the last part of the url as
the file name. What you'll see in foo.gif is ay text output generated by
curl. What you need is:

     curl.exe -o foo.gif "http://sat106......"

Ralph Mitchell

-------------------------------------------------------------------
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 2011-04-09