Re: [flask] Problem with file binary data
- Bruno Garcia
- 2013-07-27 @ 04:01
Here's the trace error:
TypeError: You are required to pass either a unicode object or a utf-8
> string here. You passed a Python string object which contained non-utf-8:
> <lots of bytes here>
And here's my code using Flask-OAuth post function
On Fri, Jul 26, 2013 at 11:10 PM, Mauricio de Abreu Antunes <
> Why did it not work for you?
> Do you have any stacktrace or error message?
> 2013/7/26 Bruno Garcia <firstname.lastname@example.org>:
> > Hello,
> > I'm using an API in OAuth (I'm using Flask-OAuth) and I have a method to
> > upload files (images) that I want to use.
> > The way I want to do it is to have a form in an HTML template, that form
> > posts the image to my route and that uploads the file through the API
> > Method.
> > But the API method requires the file to be sent as binary data.
> > I tried sending the stream data from the request:
> >> request.files['image].stream.readlines()
> > But that didn't work for me.
> > What method should I be using to send the binary data through a POST?
> > Any help is appreciated,
> > Bruno
> Mauricio de Abreu Antunes
> Mobile: (51)930-74-525
> Skype: mauricio.abreua