CGI "download" prompt?

Irmen de Jong irmen at
Fri Jul 25 00:34:47 CEST 2003

Daniel Orner wrote:

> Unfortunately,
> the files that I'm trying to give the user are HTML files. How do I
> make it so the browser prompts to save the file rather than just
> display it in the browser?

Try setting the Content-Type: header to something other than text/html,
such as:   application/octet-stream

I think that any browser that respects the mime type will prompt to save
a file with this mime-type.

YMMV, especially with IE, because that thing tends to try to act
'smart' and looks at the file extension to determine
what to do with the file. It will likely just display it....


More information about the Python-list mailing list