[Gllug] CGI Scripts/Apache

Sean Burlington gllug at uncertainty.org.uk
Mon Mar 11 21:40:12 UTC 2002


On Monday 11 March 2002 1:55 pm, Alan Peery wrote:
> "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

I rekon you can get around this M$ bug if you can call your cgi script 
"mysript.csv" - should still be able to get apache to execute it if it has 
the right permissions.

never tried this though, and it wouldn't work for a script that returns 
various file formats - but getting the general public to download 12Mb 
patches can be tricky.

most sites seem to resort to 'right click and choose save as'

-- 

Sean

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




More information about the GLLUG mailing list