got*_*002 2 zip cherrypy stream
我有这个代码(即时压缩和流)
@cherrypy.expose
def backup(self):
path = '/var/www/httpdocs'
zip_filename = "backup" + t.strftime("%d_%m_%Y_") + ".zip"
cherrypy.response.headers['Content-Type'] = 'application/zip'
cherrypy.response.headers['Content-Disposition'] = 'attachment; filename="%s"' % (zip_filename,)
#https://github.com/gourneau/SpiderOak-zipstream/blob/3463c5ccb5d4a53fc5b2bdff849f25bae9ead761/zipstream.py
return ZipStream(path)
backup._cp_config = {'response.stream': True}
Run Code Online (Sandbox Code Playgroud)
我遇到的问题是当我下载文件时我无法浏览任何其他页面或发送任何其他请求,直到下载完成...我认为问题是cherrypy不能一次提供多个请求/每个用户
有什么建议吗?
| 归档时间: |
|
| 查看次数: |
1573 次 |
| 最近记录: |