Xsendfile not working

Hi,

I am running apache web server 2.2.4 in front of mongrel on linux.
I can’t get x_send_file to work.

A couple errors are happening.

  1. In apache, I have the configured where mydir is the
    directory containing the files I want to download with XSendfile. When
    I have “XSendFile on” directive within the Directory definition, mongrel
    serves up the download file itself instead of handing it off to apache.

To work around this problem, I temporarily put “XSendFile on” in as a
global directive- i.e. not within a <Directory …> or <Files …> tag.
This I think got me past that error and onto the next which is:

  1. A request is going to apache now, but it is not that of the header I
    constructed in my ruby code. It reads
    /[path-to-controller];form_action?[query-string]

my code:
x_send_file(zip_file.to_s, :filename => ‘hobolink.zip’)
OR
response.headers[‘Content-Type’] = “application/force-download”
response.headers[‘Content-Disposition’] = “attachment;
filename=“myfile.zip””
response.headers[“X-Sendfile”] = “#{path}”
response.headers[‘Content-Length’] = File.size(zip_file.to_s)

For the minimal amount of documentation I can find on implementing this
feature, I feel like it should be very simple. For some reason, I’m
having a hard time getting the configuration right.

thanks in advance!
Danielle