I am trying to save a png in my rails app using the below code
uploader = AvatarUploader.new
uploader.store!(params[:image])
But it's throwing ArgumentError (invalid byte sequence in UTF-8)
What am i doing wrong here?
I am posting it via an ios app using AFNetworking.
Here's a quick excerpt from this answer adapted to your question:
uploader = AvatarUploader.new
File.open(params[:image]) do |file|
something = uploader.store!(file)
end
uploader.retrieve_from_store!(self.file_name)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With