Download multiple files in Django without creating zip

14
December 10, 2019, at 11:00 PM

Is there a way to download multiple files in Django without creating zipfile on single click/request. For downloading single file I am using the following code in views.py:

def download_file(request): 
   the_file = '/some/file/name.png' 
   filename = os.path.basename(the_file) 
   chunk_size = 8192 
   response = StreamingHttpResponse(FileWrapper(open(the_file, 'rb'), chunk_size), 
                           content_type=mimetypes.guess_type(the_file)[0]) 
   response['Content-Length'] = os.path.getsize(the_file)     
   response['Content-Disposition'] = "attachment; filename=%s" % filename 
   return response
Also the code should be capable of downloading large files in size of 100GB max as I am dealing with video files with high resolution

READ ALSO
Unable to write policy document in aws cdk using python

Unable to write policy document in aws cdk using python

Hi I am working on AWS CDKI am trying to create policy

42
How to use regex to extract a number from a URL using pandas

How to use regex to extract a number from a URL using pandas

I'm at a stage to extract the page number from a URL which I got from web scrapingThis page number I will use to make a loop

23
How can I make this query in Django?

How can I make this query in Django?

I have theese fields(test_type, status, begin_time, and_time)The status field has three state(0, 1 or 2)

44