[Catalyst] Re: "Save as..."

A. Pagaltzis pagaltzis at gmx.de
Sun Nov 11 07:18:30 GMT 2007


* Octavian Rasnita <orasnita at gmail.com> [2007-11-09 15:47]:
> If I try to save the file pressing enter on the link to
> download the file, the window that asks me if I want to save it
> appears, but after I press the "Save" button, nothing happends,
> and it doesn't ask me for the name of the file.

That’s not something you can affect from HTTP. It’s the way your
browser implements that aspect of HTTP. Apparently if you don’t
explicitly tell it that you want to save something under a
different name from the one in the URI (or the header, in this
case), it won’t ask you for a name.

I admit, I personally like that. I remember the days when the
“Save As” dialog was routinely popped up, and how that made it
much more of a hassle to download things.

I think most browsers can be configured to ask if you really want
them to. I never bothered to look for such a setting though.

> Can you tell me what other headers do I need to print,

There is no way to do that with HTTP headers. Even the
Content-Disposition thing is really just a MIME thing that HTTP
inherited from internet mail. In mail, it doesn’t make sense to
have an part of the mail that prompts you for printing instead
of being displayed as an attachment.

On HTML pages, you can use Javascript to invoke the browser’s
print dialog. Many “printable version” templates on sites on the
internet have that. For other media types, you’re out of luck.

> or what else should I need to do in order to be able to save
> the file by just clicking the link (pressing enter on it)?

Well, you already can. It’s just the browser vendor decided not
to offer UI to change the filename in such a case…

Regards,
-- 
Aristotle Pagaltzis // <http://plasmasturm.org/>



More information about the Catalyst mailing list