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.