Web2Py - Upload a file and read the content as Zip file
问题 I am trying to upload a zip file from Web2Py form and then read the contents: form = FORM(TABLE( TR(TD('Upload File:', INPUT(_type='file', _name='myfile', id='myfile', requires=IS_NOT_EMPTY()))), TR(TD(INPUT(_type='submit',_value='Submit'))) )) if form.accepts(request.vars): data=StringIO.StringIO(request.vars.myfile) import zipfile zfile=zipfile.Zipfile(data) For some reason this code does work and complains of file not being a zip file although the uploaded file is a zip file. I am new to