It should be a cgi.FieldStorage object, so try request.vars.my_image.file 
to access the file object itself.

Anthony

On Monday, July 16, 2018 at 3:18:44 PM UTC-4, [email protected] wrote:
>
> I need to upload an image in a post REST service
> and process the uploaded image for further processing.
>
> Though I can read the filename, size or 'type' of the file but not able to 
> get the content of the same. 
> by using request.vars
>
> request.vars.my_image
>
>
>
> I want to utilize the file by either reading the content as the stream the 
> send it directly or can save it locally and then read in normally.
>
> I tried even
>
> with open('img.jpg', 'w+') as the_file:
>     the_file.write(request.vars.image1)
>
> but ended up with 
> TypeError: expected a character buffer object
>
> Please help
>

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to