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