def shujubiao(request):
contact_id=request.GET["id"]
c=Contact.objects.get(id=contact_id)
fullfilepath = os.path.join(MEDIA_ROOT,"t_证书数据表.xml")
logging.info(fullfilepath)
data=genShujubiao(c,fullfilepath)
t=HttpResponse(data,content_type="text/xml")#application/application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")#content_type="text/xml")#application/vnd.ms-excel")
tstr='attachment; filename=%s' % c.yonghu+"_"+c.yiqixinghao+"_证书数据表.xml"
t['Content-Disposition'] = tstr.encode("gb2312")
return t
django view返回中文名称文件
最新推荐文章于 2022-04-27 16:19:04 发布