Answer the question
In order to leave comments, you need to log in
Why do I get a Failed - Network error when downloading a file?
simple code for uploading a file from the server:
from django.http import HttpResponse, FileResponse
...
def get_file(request, type):
item = Download.objects.get(name=type)
filename = item.file.name.split('/')[-1]
response = FileResponse(item.file)
response['Content-Disposition'] = 'attachment; filename=%s' % filename
return response
Answer the question
In order to leave comments, you need to log in
I think it's because of nginx.org/ru/docs/http/ngx_http_core_module.html#c...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question