Hi all,
I'm new to WSGI on python; but have a windows server that's got isapi_wsgi installed on it. I also have a script that handles my GET requests all up and running great. The thing is, someone sends me a request, and I need to return a zip file to the requester. The following code is in my GET handler and it works, but doesn't seem like the right way to return the zipfile:
# open zip file return it
fin = open(zOutFilename, "rb")
start_response( "200 OK", [('Content-Type', 'application/zip')])
return fin.read()
The thing is, you're returning a 'stream' - which means you lose the filename (the browser simply names it the name of the GET query) and it seems awfully slow.
Is there a better way to return a file for download with wsgi then this method?
Thanks in advance