Convert base64 image to StringIO for Carrierwave
问题 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 like to send it using ember's createRecord and commit(): this.get('store').createRecord(Emb.Painting, {name: newName, image: newImage}); Then I want to convert it to StringIO for carrierwave and save it: StringIO.class_eval { def original_filename; "stringiohaxx.jpg"; end } io = StringIO.new(Base64.decode64(params[:painting][:image])) @painting = Painting