I am new to WSGI in python; but there is a windows server on which isapi_wsgi is installed. I also have a script that processes my GET requests and works fine. The fact is that someone sends me a request, and I need to return the zip file to the requestor. The following code is in my GET handler, and it works, but does not seem to be the correct way to return a zip file:
fin = open(zOutFilename, "rb")
start_response( "200 OK", [('Content-Type', 'application/zip')])
return fin.read()
The fact is that you are returning a "stream" - this means that you are losing the file name (the browser simply calls it the GET request name), and it seems to be very slow.
Is there a better way to return the file to be downloaded using wsgi, then this method?
Thanks in advance
source
share