Forum: Mongrel how to i force apche to handle download request

Posted by Amit Tomar (amit-singh)
on 2010-09-23 14:58
hii all, Am running apche as frontend to mongrel ,i added these line in
Apache's httpd.conf file

LoadModule rewrite_module modules/mod_rewrite.so

LoadModule proxy_module modules/mod_proxy.so

LoadModule proxy_balancer_module modules/mod_proxy_balancer.so

LoadModule proxy_http_module modules/mod_proxy_http.so

LoadModule xsendfile_module modules/mod_xsendfile.so

XSendFile on

XsendFileAllowAbove on

<VirtualHost *: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 application i have to downlaod large stream and i don't want
rails to serve it,i would like apache to server this request but with
current setting rail i serving this request.

this is my code for download

filename = "#{@stream.location}"

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

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

response.headers["X-Sendfile"] = filename

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

render :nothing => true

with current setting am able to downlaod files of 1.1. gb only once to
download it again i have to restart both mongrel and apache...
Posted by Nike Mbt (Guest)
on 2010-10-30 10:13
<a 
href="http://www.mbt-shoescom.com/mbt-sports-shoes-mens-best-mbt-shoes-for-walking-chapa-gtx-lace-up-moc-toe-grey-blue-p-260.html
 <a 
href="http://www.mbt-shoescom.com/mbt-sports-shoes-mens-best-mbt-shoes-cheap-greywhite-p-252.html"> 
MBT Shoes </a>
 <a 
href="http://www.mbt-shoescom.com/mbt-sports-shoes-mens-best-price-mbt-shoes-chapa-gtx-lace-up-toe-brow-white-p-257.html"> 
MBT Shoes Chapa </a><a 
href="http://www.mbt-shoescom.com/mbt-sports-shoes-mens-black-mbt-shoes-sport-black-m-p-338.html"> 
MBT Shoes </a><a 
href="http://www.bottes-ugg-bottes.com/bottes-ugg-classic-bottes-ugg-classic-mini-bottes-ugg-short-en-noire-p-511.html"> 
Bottes Ugg Short </a>
<a href="http://www.bottes-ug ode </a>
<a 
g-bottes.com/bottes-ugg-classic-bottes-ugg-classic-mini-bottes-ugg-milan-mode-en-sable-p-512.html"> 
Bottes Ugg Milan M 
href="http://www.bottes-ugg-bottes.com/bottes-ugg-classic-bottes-ugg-classic-corchet-ugg-france-bottes-en--beige-p-500.html"> 
Ugg France Bottes </a>
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.