I am not having any luck trying to download some script-generated text from a browser (IE5/Mac in this case). When I try the following in a python method: request.RESPONSE.setHeader('Content-Disposition', 'attachment; filename=file.txt') print 'Hello, filesystem!' return printed all that happens is that IE displays the text. Not very helpful. Any suggestions gratefully received. - rmgw <http://www.electricfish.com/hawkfish/> ---------------------------------------------------------------------------- Richard Wesley Electric Fish, Inc. hawkfish@electricfish.com "I found it at the bottom of a locked filing cabinet, in a disused lavatory with a sign on the door saying 'Beware of the leopard.'" - Douglas Adams, _The Hitchhiker's Guide to the Galaxy_
Richard Wesley writes:
I am not having any luck trying to download some script-generated text from a browser (IE5/Mac in this case). When I try the following in a python method:
request.RESPONSE.setHeader('Content-Disposition', 'attachment; filename=file.txt') print 'Hello, filesystem!' return printed
It might help to use RESPONSE.setHeader('Content-Type','application') in addition. Some browsers are known to ignore this header and stubbornly look at the filename. In this case, you might need to drop the ".txt" extension. Dieter
At 12:01 AM +0200 4/19/02, Dieter Maurer wrote:
Richard Wesley writes:
I am not having any luck trying to download some script-generated text from a browser (IE5/Mac in this case). When I try the following in a python method:
request.RESPONSE.setHeader('Content-Disposition', 'attachment; filename=file.txt') print 'Hello, filesystem!' return printed
It might help to use
RESPONSE.setHeader('Content-Type','application')
in addition.
Yeah, I set it to 'text/x-my-type' and that seemed to slap it around enough.
Some browsers are known to ignore this header and stubbornly look at the filename. In this case, you might need to drop the ".txt" extension.
Good point. - rmgw <http://www.electricfish.com/hawkfish/> ---------------------------------------------------------------------------- Richard Wesley Electric Fish, Inc. hawkfish@electricfish.com "Grass will get you through times of no money better than money will get you through times of no grass." - Fat Freddy
Richard Wesley wrote:
I am not having any luck trying to download some script-generated text from a browser (IE5/Mac in this case). When I try the following in a python method:
request.RESPONSE.setHeader('Content-Disposition', 'attachment; filename=file.txt') print 'Hello, filesystem!' return printed
all that happens is that IE displays the text. Not very helpful.
Any suggestions gratefully received. - rmgw
read and weep: http://msdn.microsoft.com/library/default.asp?url=/workshop/networking/monik... cheers, oliver
participants (3)
-
Dieter Maurer -
Oliver Bleutgen -
Richard Wesley