I've tried a million different tutorials on the internet for how to upload a Base64 image from my iOS application to my rails app. It seems that no matter how I format the request it just won't get accepted.
Does anyone know definitively how to upload a Base64 image to paperclip?
I tried sending the param as JSON
{ "thumbnail_image": "base64_data..." }
I also tried appending the data url
{ "thumbnail_image": "data:image/jpeg;base64,alkwdjlaks..." }
I tried sending a JSON object with and without data url
{ "thumbnail_image": { "filename": "thumbnail.jpg", "file_data": "base64_data...", "content_type": "image/jpeg" } }
I consistently get these Paperclip::NoHandlerError
s and then it dumps a giant blob of data into my log.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…