from django.http import FileResponse
def download(request):
    if.....
        file=open([path],'rb')
        response=FileResponse(file)
        response['Content-Type'] = 'application/octet-stream'
        response['Content-Disposition'] = 'attachment;filename="[filename].xls"'
  return response

相关文章:

  • 2021-05-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-16
  • 2022-12-23
  • 2022-01-05
猜你喜欢
  • 2022-01-20
  • 2022-12-23
  • 2022-12-23
  • 2021-07-28
  • 2022-12-23
  • 2021-10-10
相关资源
相似解决方案