Forum: Ruby on Rails Return binary file?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Ead43bcb0202410540a6a7cee5955d46?d=identicon&s=25 Fresh Mix (giga)
on 2009-03-08 09:58
I trying to get http://festivaltts4r.rubyforge.org/ 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 http://xxx.com/myrailsap/sayhello/
It generate mp3 file and return it to browser. No html code, return only
mp3 file.
81b61875e41eaa58887543635d556fca?d=identicon&s=25 Frederick Cheung (Guest)
on 2009-03-08 13:55
(Received via mailing list)
Read up on send_file, send_data (and then things like X-SendFile and X-
Accel-Redirect).

Fred
This topic is locked and can not be replied to.