On Tue, Sep 9, 2008 at 1:39 AM, jago <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I want to store a small image in my appstore. It works well when I
> read in the images from python.
>
> Now I want to store them via a Post from my Java-Client. The Post and
> everything else works pretty well. Also getting the image from the
> request does work:
>
>        image   = self.request.get('image')
>
> It fails when I try to construct my Entity-Instance:
>
>        pic = ImageEnt(data=db.Blob(image))
>        pic.put()
>
>
> The console tells me:
>
>        TypeError: Blob() argument should be str instance, not unicode
>
>
> How do I have to read in my image in Java to ensure that it is a str
> instance and not unicode? Or is it send as unicode automatically? Do I
> have to convert it somehow in Python before constructing a Blob?

A blob does have to be made from a str.  How your image became
unicode, I don't know.  By Java-client, you mean a program that's
calling a web service?  It's hard to see how it would matter what kind
of client it is because the server has nothing but the HTTP headers
and body.  Without knowing what exactly the request contained and how
you extracted the 'image' variable, I can't speculate further.  It's
possible the Java program is setting a header differently or
formatting the variables differently that is somehow triggering
Unicode, but I can't think of how.


-- 
Mike Orr <[EMAIL PROTECTED]>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to