On Monday 27 September 2010, Amit Tomar wrote:
> Frederick Cheung wrote:
> > On Sep 27, 12:28?pm, Amit Tomar <[email protected]> wrote:
> >> 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
> > 
> > That looks entirely normal to me - your rails code does need to be
> > invoked at some point in order for it to tell apache which file to
> > send.
> > 
> > Fred
> 
> But Fred lot of experts are saying ,mongerl doesn't render anything
> while  apche handle the request and one more thing how do i make sure
> apache is handling is request??

Amir, I'm not sure, but you might be misunderstanding what xsendfile is 
for and how it works. This mechanism is not intended to serve "ordinary" 
static files located in the public directory of an application. Rather, 
it is a way for your controller to hand off serving a file to Apache 
instead of doing it from within Rails.

So, your controller *has* to be involved. It's the job of the controller 
action to decide which file to return in the response and then call 
send_file with that file as a parameter. In the production environment, 
this has the effect that the Rails process does not respond with the 
file itself. Instead, Rails sets a special header which in turn is 
picked up by Apache (or nginx, lighttpd) and interpreted in such a way 
that it now serves the named file.

Michael

-- 
Michael Schuerig
mailto:[email protected]
http://www.schuerig.de/michael/

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to