Rails send_file don't play mp4
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I have a Rails app that protects the uploaded videos putting them into a private folder. Now I need to play these videos, and when I do something like this in the controller: def show video = Video . find ( params [: id ]) send_file ( video . full_path , type : "video/mp4" , disposition : "inline" ) end And open the browser(Chrome or FF) at /videos/:id it doesn't play the video. If I put the same video at the public folder, and access it like /video.mp4 it will play. If I remove the dispositon: "inline" it will download the video