Convert base64 image to StringIO for Carrierwave

后端 未结 2 539
眼角桃花
眼角桃花 2021-02-04 20:33

I am hoping someone can help me understand this. I have a base64 string for an image:

\"data:image/jpeg;base64,/9j/4AAQSkZJRgABA...\"

I would

2条回答
  •  無奈伤痛
    2021-02-04 20:37

    And yes that string does need to be broken up:

    var data = newImage.split(',');  
    this.get('store').createRecord(Emb.Painting, {name: newName, image: data[1]});  
    

    I doubt this is the best way...

提交回复
热议问题