I'm working on a REST API, trying to upload a picture of user with:
No handler found for #<Hashie::Mash filename="user.png" head="Content-Disposition: form-data; name=\"picture\"; filename=\"user.png\"\r\nContent-Type: image/png\r\n" name="picture" tempfile=#<File:/var/folders/7g/b_rgx2c909vf8dpk2v00r7r80000gn/T/RackMultipart20121228-52105-43ered> type="image/png">
I tried testing paperclip with a controller and it worked but when I try to upload via grape api its not working my post header is multipart/form-data
My code for the upload is this
user = User.find(20)
user.picture = params[:picture]
user.save!
So if it is not possible to upload files via grape is there any alternative way to upload files via REST api?