Save base64 image in django file field

后端 未结 4 2002
栀梦
栀梦 2020-12-13 04:02

I have following input

\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA7YAAAISCAIAAAB3YsSDAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAA5JxJREFUeNrsnQ         


        
4条回答
  •  再見小時候
    2020-12-13 04:17

    This question looks like it should help: Django - how to create a file and save it to a model's FileField?

    You should be able to decode the base64 string and supply that as the content argument to FieldFile.save:

提交回复
热议问题