serving html from a python script in IE

J. Cliff Dyer jcd at sdf.lonestar.org
Thu Nov 1 13:31:39 EDT 2007


bluegray wrote:
> I'm writing a script that outputs html. It works fine in Firefox,
> however, IE wants to download the file instead of displaying the
> output. I keep getting the file download dialog instead of the html
> page.
>
> I am doing something like this:
>
> print 'Content-Type: text/html ; charset=utf-8\nCache-Control: no-cache
> \n'
> print '<html><body>some text and html</body></html>'
>
> I also tried various things in .htaccess which has the following line:
>
> AddHandler cgi-script .py
>
> Any help will be appreciated.
>
>   
If you take out the space between text/html and ; it works just fine.

(In other words, there is no mime-type "text/html ")

Cheers,
Cliff




More information about the Python-list mailing list