Forum OpenACS Development: File-storage download: How to _force_ a browser to download a file

Hi,

I remember that I have seen a comment in some old file download page a long time ago, talking about how to force a browser to download a file instead of opening it in the local window.
"Force" means that the browser used the download option, without regard of the particular browser configuration.

It may have something to do with a MIME-type not being recognized by the usual browsers, with a strange HTTP feature or some AOLServer option...

Thanks in advance,
Frank

mailto:fraber@fraber.de, http://www.fraber.de/

You can specify which MIME types are accepted in the config.tcl file. I had to add entries for Word or Excel.
Hi Frank,

I think you might be interested in the Content-Disposition HTTP header:

    ns_set put [ad_conn outputheaders] Content-Disposition attachment

You can also optionally add a filename parameter as well.  See:

    http://www.faqs.org/rfcs/rfc2183.html

for more info.

Lastly, I'm not sure if all browsers support this header.