Hello everyone!
I am try to upload some pictures from safari on iPod, using this
method
http://www.cliqcliq.com/support/quickpic/#web-app-integration
and uploads are sent using standard POST multipart/form-data encoding.
This is my code for receiving submissions:
----------------------------------------------
def receiveImage():
if request.vars:
db(db.poll.id == 12).update(image =
request.vars.upload_file.file.read())
return XML("""
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//
EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>success</key>
<true/>
</dict>
</plist>
""")
return False
but when i tried to check the image from admin panel it links to:
http://localhost:8001/init/appadmin/download/db/%3Copen%20file%20'%3Cfdopen%3E',%20mode%20'w+b'%20at%200x4485660%3E
using print(request.vars.upload_file) i got:
FieldStorage('upload_file', 'quickpic.jpg', '\xff\xd8\xff
\xe0\x00\x10JFIF......
could you tell me how to save this file into db? thanks!!
Regards,
Zhe