def download_file(request):
file=open('F://user.xls','rb')
response =StreamingHttpResponse(file)
response['Content-Type']='application/octet-stream'
response['Content-Disposition']='attachment;filename="user.xls"'
return response
django入门指南(五)django下载所有格式文件
最新推荐文章于 2024-05-09 17:32:05 发布