Hi all,

I am using Pyamf to transfer a dynamically generated large image from
Flex to Django.
On the Django side i receive the encodedb64 data as a parameter:

My Item model as an imagefield.
What i have trouble to do is saving the data as the File Django Field.

def save_item(request, uname, data):
    """ Save a new item """
    item = Item()

    img = cStringIO.StringIO()
    img.write(base64.b64decode(data))
    myFile = File(img)

   item.preview.save('fakename.jpg', myFile, save=False)

That would not work because my File object from StringIO has no mode,
name etc.
I also think that using StringIO will load the image data completely
in memory so i may just give up on the AMF for this particular case
and use POST.

What do you think ?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" 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/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to