How is it possible to set the HTTP header of the link to this file (qqq.lqp)?
f= open(os.path.join(LQS.WEB_SERVER, 'xxx', 'qqq.lqp'), 'w')
f.write(fileInput)
f.close()
return [
T.a(href="/xxx/qqq.lqp")['Save'],
webform.renderForms()[FORM_LAYOUT],
]
On Thursday 13 March 2008, Suha Onay wrote:You can set the following HTTP header:
> I run this page from Firefox, IE and IE Mobile.
> I want the browser open a save as dialog but it shows the file within the
> browser.
> How can I achieve this?
Content-Disposition: attachment; filename
Where "filename" is the suggested name for saving the file.
Note that HTTP headers must be ASCII. It is possible to encode Unicode in
HTTP headers, but it's a real pain to get it working in all browsers. At
least, I haven't been able to find a single way of encoding that works for
IE, Mozilla and Opera, so now I choose a different way of encoding
depending on the user agent header.
Bye,
Maarten
_______________________________________________
Twisted-web mailing list
Twisted-web@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web