How pyamf.amf3.ByteArray save to ImageField?
I'm getting object 'pyamf.amf3.ByteArray' How can I save it to ImageField ?
obj - an object in django, data - array which get from Flash application
data['finalImage'] - a pyamf.amf3.ByteArray and contains image
obj.image - an ImageField
new_name - name for a picture (without path)
from django.core.files.base import ContentFile
obj.image.save(new_name, ContentFile(data['finalImage'].read()))
obj.save()
精彩评论