serving large media files from the assets folder in rails

拟墨画扇 提交于 2019-12-24 08:56:54

问题


I want to put some rather large sound files into my assets folder in rails.

/app/assets/sounds
--- file1.wav
----file2.wav

when calling them thru the following URL

http://localhost:3000/assets/file1.wav

Rails (3.2.x) the file will be "served" (somehow) but I can never play it in the browser.

If however I put those files into the public folder they will be served and can be played.

I assume this is related to the fact that the public folder isn't touched by rails but is served by rack (afaik). I found a solution to use send_file but is this really needed?

来源:https://stackoverflow.com/questions/12285609/serving-large-media-files-from-the-assets-folder-in-rails

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!