Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
非常简单的问题,我目前希望用户下载(不打开)存储在 python Twisted Web 服务器上的 csv 文件。该文件当前在访问其 URL 时在浏览器中打开。
您可以像这样设置响应标头:
request.responseHeaders.setRawHeaders( 'Content-Disposition', ['attachment; filename="foo"'])