开发者

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()  
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜