Upload a file with web2py on Google App Engine
I have a problem deploying my application written in web2py on Google App Engine. Everything works well on localhost, but on GAE I cannot access the content of an uploaded file.
When I check the request.vars.my_upload_field var on localhost, I get: FieldStorage('upload_field', 'my_file.txt', 'File content')
But on GAE I only have: FieldStorage('up开发者_高级运维load_field', 'my_file.txt')
No file content... I did not do anything special (I believe...)
Why do I have such behaviour and how to fix it?
PS: I am using a SQLForm(db.my_table) that has an 'upload' field.
see detailed instructions for web2py and GAE blobstore upload here: http://web2pyslices.com/main/slices/take_slice/63
I haven't personally used web2py with GAE, but the official documentation
mentions something about difficulties in uploading files to the app-engine filesystem using web2py. So probably you could instead use GAE's own file-upload abilities like shown in this SO thread
Hope this helps a bit.
精彩评论