我得到了对象'pyamf.amf3.ByteArray‘如何将其保存到ImageField?
发布于 2010-08-02 18:38:55
obj - django中的一个对象,数据数组来自于Flash应用程序
data'finalImage' -一个pyamf.amf3.ByteArray,包含图片
obj.image - an ImageField
new_name -图片的名称(不带路径)
from django.core.files.base import ContentFile
obj.image.save(new_name, ContentFile(data['finalImage'].read()))
obj.save() https://stackoverflow.com/questions/3364078
复制相似问题