How to deploy zip files (or other binaries) trough cgi in Python?
问题 I'm coding a small website with Python and CGI where users can upload zip files and download files uploaded by other users. Currently I'm able to upload correctly the zip's, but I'm having some trouble to correctly send files to the user. My first approach was: file = open('../../data/code/' + filename + '.zip','rb') print("Content-type: application/octet-stream") print("Content-Disposition: filename=%s.zip" %(filename)) print(file.read()) file.close() But soon I realized that I had to send