I'm getting object 'pyamf.amf3.ByteArray' How can I save it to ImageField ?
Asked
Active
Viewed 490 times
1 Answers
1
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()

mapcuk
- 800
- 1
- 7
- 21