Hey, I am trying to manually upload a file from a request without using 
SQLFORMS, as this is is done through a REST client. This is is what I have 
so far:

id = db.image.insert(file = 
db.image.file.store(request.vars.profile_pic.file,request.vars.profile_pic.filename))


This works, but fails to upload the BLOB, and only uploads the filename? 
Calling the link generated, only downloads an empty file.

I also have tried this


stream = open(request.vars.profile_pic.file.read(),'rb')
id = db.image.insert(file = 
db.image.file.store(stream,request.vars.profile_pic.filename))


This gives the error of argument 1 must be encoded string without NULL bytes, 
not str


By the way, my application is running on GAE, and my client is a mobile 
application that sends the data through HTTP request.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to