Return binary file?

I trying to get to work.

“Hello world!”.to_mp3("/tmp/xxx.mp3")

With this I can generate a mp3 file, but how can I return it to browser?

So if I open URL
It generate mp3 file and return it to browser. No html code, return only
mp3 file.

Read up on send_file, send_data (and then things like X-SendFile and X-


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs