Reputation: 5823
Pretty simple question, I am currently wanting for users to download (not open) a csv file that is stored on a python Twisted Web Server. The file currently opens in the browser when accessing its URL.
Upvotes: 1
Views: 1209
Reputation: 48335
You can set response headers like this:
request.responseHeaders.setRawHeaders(
'Content-Disposition', ['attachment; filename="foo"'])
Upvotes: 3