13
我正在努力与send_file
与rails 3.0.9运行红宝石1.9,乘客3.0.8在Apache的Ubuntu的清醒 xsendfile模块安装并加载到ApacheRails 3,apache&passenger,send_file发送零字节文件
root~# a2enmod xsendfile
Module xsendfile already enabled
它在正确的符号链接
lrwxrwxrwx 1 root root 32 Aug 8 11:20 xsendfile.load -> ../mods-available/xsendfile.load
config.action_dispatch.x_sendfile_header = "X-Sendfile"
设在我production.rb启用MODS-
用零个字节文件由send_file结果被发送到浏览器
filepath = Rails.root.join('export',"#{filename}.csv")
if File.exists?(filepath)
send_file filepath, :type => 'text/csv'
end
肖恩,我想你可能就在这里。这些配置选项不是x_sendfile模块的默认值。 – Rob
它似乎XSendFile的默认值没有打开,但关闭。在这里查看可能的配置选项和默认值:https://tn123.org/mod_xsendfile/ – Cam