37,719
社区成员
发帖
与我相关
我的任务
分享
def download(request):
aa = request.GET # 资源路径
bb = request.GET #资源名称
file = open('static\\files\\' + aa + '\\' + bb, 'rb') #问题出在这一行
response = FileResponse(file)
response = 'application/octet-stream'
# response = 'attachment;filename=\"' + bb + '\"'
response = 'attachment;filename=\"' + escape_uri_path(bb) + '\"'
return response
http://127.0.0.1/download/?aa=xxx&bb=xxx2
的方式进行。我也试过绝对路径,根本没有速度,这个部署中应该怎么操作呢?