[Mongrel] problem in downloading large file with apache+mongrel

James Tucker jftucker at gmail.com
Thu Sep 23 13:00:52 EDT 2010


On 23 Sep 2010, at 02:42, Amit Tomar wrote:

> James Tucker wrote:
>> On 22 Sep 2010, at 12:00, Amit Tomar 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....

You confuse me for someone that doesn't read. You also clearly don't understand "should", or what I've just told you.


More information about the Mongrel-users mailing list