# Problem in downloading large file with apache+mongrel

**URL:** <https://www.ruby-forum.com/t/problem-in-downloading-large-file-with-apache-mongrel/195392>\
**Category:** Mongrel\
**Created:** [September 22, 2010, 3:01pm UTC](https://www.ruby-forum.com/t/problem-in-downloading-large-file-with-apache-mongrel/195392 "2010-09-22T15:01:00Z")\
**Posts on this page:** 1\
**Page:** 2

<div class="post-metadata">

**Author:** ![amit-singh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/9f8e36/32.png) [@amit-singh](https://www.ruby-forum.com/u/amit-singh)\
**Post date:** [September 23, 2010, 7:42am UTC](https://www.ruby-forum.com/t/problem-in-downloading-large-file-with-apache-mongrel/195392/21 "2010-09-23T07:42:41Z")

</div>

James T. wrote:

> On 22 Sep 2010, at 12:00, Amit T. wrote:
> 
> > luis i change my code as you said
> > 
> > filename = “#{@stream.location}”  
> > response.headers[‘Content-Type’] = “application/force-download”  
> > response.headers[‘Content-Disposition’] = “attachment;  
> > filename="#{File.basename(filename)}"”
> 
> The problem is here ^^^^
> 
> > response.headers[“X-Sendfile”] = filename  
> > response.headers[‘Content-length’] = File.size(filename)
> 
> File.size should fail, as rails will be in Dir.pwd == Rails.root, and as  
> such, File.size(filename) for filename with no path should fail. This  
> should be raising Errno::ENOENT.

but tucker, i am getting failed to allocate memory and that is also of  
second time…

[Previous page](https://www.ruby-forum.com/t/problem-in-downloading-large-file-with-apache-mongrel/195392.md?page=1)
