Im from a PHP background so I know this is possible. I’m not sure how to do it in rails though.
Basically instead of outputting text I’d like to output a binary stream (basically a file) and throw in a Content-Type: audio/mpeg as well as a Content-Disposition header so the browser accepts it as a download
I also have this in a variable that I’d like to print as the binary stream without writing the file to disk.
You can use
send_data.