[Gllug] CGI Scripts/Apache

Alan Peery peery at io.com
Mon Mar 11 13:55:55 UTC 2002



"t.clarke" wrote:

> I need to output a dynamic web-page response from a cgi 'script' in 'csv'
> text format, such that instead of displaying on the browser screen it
> saves into a file.
>
> The method I am using, which works fine with non-ascii file-content is as
> follows:-
> Send HTTP Headers:
> Content-Type: application/octet-stream
> Content-Disposition: attachment; filename=zzzzzz.csv
> followed by a blank line
> followed by the data
>
> Using netscape as the browser this works and a 'box' opens up offering
> the choice to save to disc.
> Using Internet Explorer as the browser, it seems to ignore the headers and
> treat the content as plain text; displaying it on the screen.

This is a bug, and relates to some of the serious security flaws that Microsoft has
recently patched regarding content type headers.  I suspect that the behaviour will
change if you load service pack 2 for IE 5.5...

Alan



-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list