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

Amit Tomar lists at ruby-forum.com
Wed Sep 22 11:17:23 EDT 2010


Amit Tomar wrote:
> Amit Tomar wrote:
>> Luis Lavena wrote:
>>> On Wed, Sep 22, 2010 at 11:22 AM, Amit Tomar <lists at ruby-forum.com> 
>>> wrote:
>>>>
>>>> soory but how do i setup s virtual server configuration??
>>> 
>>> Read apache documentation.
>>> 
>>>> and i have to install that plugin??
>>> 
>>> No, in your controller action set the headers, *do not* install the 
>>> plugin.
>>> --
>>> Luis Lavena
>>> AREA 17
>>> -
>>> Perfection in design is achieved not when there is nothing more to add,
>>> but rather when there is nothing more to take away.
>>> Antoine de Saint-Exup鲹
>> 
>> 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)}\""
>> response.headers["X-Sendfile"] = filename
>> response.headers['Content-length'] = File.size(filename)
>> render :nothing => true
>> 
>> 
>> this is how it is processed...
> 
> Processing StreamsController#download (for 127.0.0.1 at 2010-09-22 
> 20:22:06) [GET]
>   Parameters: {"id"=>"6600"}
>   ?[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` = 6600) ?[0m
>   ?[4;36;1mCACHE (0.0ms)?[0m   ?[0;1mSELECT * FROM `streams` WHERE 
> (`streams`.`id` = 6600) ?[0m
> 0) ?[0m
> Completed in 65347ms (View: 0, DB: 0) | 200 OK 
> [http://src/streams/download/6600]

and these are the lines i added in httpd.conf
<Directory "d:/dm">
Options Indexes FollowSymLinks
AllowOverride FileInfo
Order allow,deny
Allow from all
</Directory>


for virtual server configuration to  access D:
what should i do now
-- 
Posted via http://www.ruby-forum.com/.


More information about the Mongrel-users mailing list