Forum: Mongrel problem when downloading files with xsendfile

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
4b1d69e2ac9037081497056f70196369?d=identicon&s=25 Amit Tomar (amit-singh)
on 2010-09-27 14:51
Hii All, i loaded mod_xsendfile.so in apche , i added few line in
httpd.conf files

LoadModule xsendfile_module modules/mod_xsendfile.so

XSendFile on

XSendFileAllowAbove on

<VirtualHost * localhost:80>
ServerName src

DocumentRoot C:/InstantRails-2.0-win/rails_apps/src/public/

ProxyPass / http://localhost:3000/

ProxyPassReverse / http://localhost:3000/

</VirtualHost >

now in my rails application i have a streams controller and inside
streams controller i have a function named download ,code for code
download is below

def download

@stream = Stream.find(params[:id])

filename = "#{@stream.location}"

response.headers['Content-Type'] = "application/force-download"

response.headers['Content-Disposition'] = "attachment;
filename=\"#{File.basename(filename)}\""

response.headers["X-Sendfile"] = @stream.location

response.headers['Content-length'] = File.size(filename)

render :nothing => true

end

Problem is my rails application still handling this request but i would
like apache to handle this request ,can anyone tell me how i configure
apche to handle this request??



Actully when i downloding files,mongrel rendering things,

Processing StreamsController#download (for 127.0.0.1 at 2010-09-27
16:50:47) [GET]
  Parameters: {"id"=>"6655"}
  ?[4;36;1mSQL (0.0ms)?[0m   ?[0;1mSET NAMES 'utf8'?[0m
  ?[4;35;1mSQL (0.0ms)?[0m   ?[0mSET SQL_AUTO_IS_NULL=0?[0m
  ?[4;36;1mStream Columns (0.0ms)?[0m   ?[0;1mSHOW FIELDS FROM
`streams`?[0m
  ?[4;35;1mStream Load (0.0ms)?[0m   ?[0mSELECT * FROM `streams` WHERE
(`streams`.`id` = 6655) ?[0
Completed in 78ms (View: 0, DB: 0) | 200 OK
[http://src/streams/download/6655]

It is when i am trying to download 2.2GB of file ,file is downloaded
completely,but my worry is why mongrel is rendering things if apache is
handling download
This topic is locked and can not be replied to.