CGI "download" prompt?

Daniel Orner cidolfas at rpgclassics.com
Fri Jul 25 10:19:16 EDT 2003


> 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....
>
> --Irmen

    Hmm... this doesn't seem to work. The problem is, I think, that once I
include a "Location:" header to redirect the browser, the Content-type
doesn't apply to the place I'm redirecting to. However, I don't know of any
way to include a header in a plain file that isn't a CGI file (and that's
what I want, because I want to keep the filename). >_<

    Does anyone else have any ideas?

    Thanks,

--Daniel




More information about the Python-list mailing list