源码:
response['Content_Type']='application/octet-stream'
response["Content-Disposition"] = "attachment; filename=%s" % name
下载的文件名为name,名字中有中文,下载时提示一下错误:
解决办法:
response['Content_Type']='application/octet-stream'
response["Content-Disposition"] = "attachment; filename={0}".format(name.encode('utf8'))
参考网址: