Django下载中文名文件:

Django下载中文名文件:

from django.utils.http import urlquote
from django.http import HttpResponse
content = export.export_to_xls()
response = HttpResponse()
response['Content-Type'] = 'application/octet-stream'
title = '商品管理.xls'
response['Content-Disposition'] = 'attachment;filename="%s"' % (urlquote(title))
content.save(response)
return response
 
 
上一篇:关于EXCEL if、countif 在查找数据的用法


下一篇:爬取字段 spider_text