cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: let curl automatically choose download for octet streams?

From: Guenter <lists_at_gknw.net>
Date: Fri, 12 Mar 2010 14:13:42 +0100

Guenter schrieb:
> Hi,
> I just faced again a usual stupid user error where I get a binary
> content displayed instead of stored ....
> usually this happens to me when I first check for a directory listing to
> see what files are available, and then just append the filename without
> adding -O, f.e.:
> curl ftp://server.in.the.wild/directory/
> <received directory listing>
> curl ftp://server.in.the.wild/directory/myfile.bin
>
> and content gets displayed to stdout ....
> I know, very stupid mistake, but I cant believe that I am the only one
> to whom this frequently happens ....
> I've not yet checked source if this might be easy to implement, but just
> thought that we could at least if we get a header 'octet stream' which
> clearly identifies binary content automatically imply -O so the content
> gets stored to a file instead of displayed to stdout; or am I missing
> something? Is this a bad idea?
ok, bad sample above since for ftp we can probably dont do such since we
get no headers at all IIRC, but I was more thinking of http when I wrote
this ...

Gün.

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-03-12