Skip to content

Instantly share code, notes, and snippets.

@dev-yohan
Created August 26, 2013 22:14
Show Gist options
  • Save dev-yohan/6347314 to your computer and use it in GitHub Desktop.
Save dev-yohan/6347314 to your computer and use it in GitHub Desktop.
def convert_base64_image(data, type)
io = FileIo.new(Base64.decode64(data))
io.class.class_eval { attr_accessor :original_filename, :content_type }
io.original_filename = "photo.jpeg"
io.content_type = type
self.profile_photo = io
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment