ruby - Upload MP3 Files - Invalid byte sequence in UTF-8 -


i'm working rails 5 api (carrierwave), , need put binary data (mp3 files) in postgres database.

first create simple model : rails g scaffold capsule name:string description:string file_upload:binary , : rails db:migrate update database.

after try post "postman application", , using mp3 file "file_upload" row.

but after have bad request saying :

{ "status": 400, "error": "bad request", "exception": "#sequence in utf-8>", ...

i've searched problem able me...

how can fix it? thank much. best regards.

and mp3 not string it's binary file. can either encode uuencode or store bytea.


Comments