I am writing an application where receive file like a stream like this:
zipfile = subprocess.Popen(somearguments, stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=in_stream, close_fds=True)
return zipfile.stdout.read()
How I can convert this stream to zip file, and send it to browser to download? I have read a lot of articles, but I am new in python and do not know what will be the best solution. If file is correct I will display download link:
<a href=”test.py”> "Click for download" </a>
which will redirect to test.py script.
where test.py has to receive this zip file and send it to browser for download. I have read about context-disposition and how it should be used in such cases but still do not have solution. Thank you in advance!