Hello, i have installed the OpenLiteSpeed Django droplet from digitalocean.
All my files live on a aws bucket.
Now I'm trying to download 2 different files from one django view (first_file = 60mb, second_file = 800mb) with this code:
----------------------------------------------------------------------------------------------------------------
def download_file(file_name, path_to_file, file_size):
chunk_size = 8192
response = StreamingHttpResponse(FileWrapper(path_to_file.open(file_name, 'rb'), chunk_size),
content_type=mimetypes.guess_type(file_name)[0])
response['Content-Length'] = file_size
response['Content-Disposition'] = "attachment; filename=%s" % file_name
response['X-LiteSpeed-Location'] = path_to_file
return response
----------------------------------------------------------------------------------------------------------------
However on my local machine the downloads seem to work as expected but when I try to download these files from my server using Openlightspeed,
then only the first_file (60mb) is downloaded correctly and for the second_file (800mb) I'm receiving a 503 Service unavailable
I've tried changing php.ini and http_config.conf back and forth with no success.
I am grateful for any help
Thanks in advance!
All my files live on a aws bucket.
Now I'm trying to download 2 different files from one django view (first_file = 60mb, second_file = 800mb) with this code:
----------------------------------------------------------------------------------------------------------------
def download_file(file_name, path_to_file, file_size):
chunk_size = 8192
response = StreamingHttpResponse(FileWrapper(path_to_file.open(file_name, 'rb'), chunk_size),
content_type=mimetypes.guess_type(file_name)[0])
response['Content-Length'] = file_size
response['Content-Disposition'] = "attachment; filename=%s" % file_name
response['X-LiteSpeed-Location'] = path_to_file
return response
----------------------------------------------------------------------------------------------------------------
However on my local machine the downloads seem to work as expected but when I try to download these files from my server using Openlightspeed,
then only the first_file (60mb) is downloaded correctly and for the second_file (800mb) I'm receiving a 503 Service unavailable
I've tried changing php.ini and http_config.conf back and forth with no success.
I am grateful for any help
Thanks in advance!
Attachments
-
6.3 KB Views: 4
-
72.2 KB Views: 2
-
13.9 KB Views: 1
Last edited: