Mongrel upload problem with progress bar


#1

Hello,

I’m trying to install the upload_progress gem and i can’t see the upload
progress status.

My config is :

apache2 with mod_proxy
mongrel
rails

upload.rb : ##############

require ‘rubygems’
require ‘drb’
require ‘gem_plugin’
GemPlugin::Manager.instance.load ‘mongrel’ => GemPlugin::INCLUDE
DRb.start_service ‘druby://0.0.0.0:2999’, Mongrel::UploadProgress.new
DRb.thread.join

mongrel_upload_progress.conf : ##########

uri “/”,
:handler => plugin("/handlers/upload",
:path_info => ‘/files/upload’,
:frequency => 1,
:drb => ‘druby://0.0.0.0:2999’),
:in_front => true

routes.rb :

map.connect ‘/files/’,:controller=>“files”

files_controller : #####################

class FilesController < ApplicationController
session :off, :only => :progress

def index
end

def progress
render :update do |page|
@status = Mongrel::Uploads.check(params[:upload_id])
logger.info(params[:upload_id])
page.upload_progress.update(@status[:size], @status[:received]) if
@status
end
end

def upload
render :text => %(UPLOADED: #{params.inspect}.window.parent.UploadProgress.finish();)
end
end

When i try to upload a file i got this log in my production_log :

Processing FilesController#progress (for my_IP at 2007-03-23 10:42:56)
[POST]
Parameters: {“action”=>“progress”, “controller”=>“files”,
“upload_id”=>“1174642904”}
1174642904
Completed in 0.00594 (168 reqs/sec) | Rendering: 0.00572 (96%) | DB:
0.00000 (0%) | 200 OK
[http://IP_SERVEUR/files/progress?upload_id=1174642904]

Processing FilesController#progress (for my_IP at 2007-03-23 10:42:59)
[POST]
Parameters: {“action”=>“progress”, “controller”=>“files”,
“upload_id”=>“1174642904”}
1174642904
Completed in 0.00597 (167 reqs/sec) | Rendering: 0.00574 (96%) | DB:
0.00000 (0%) | 200 OK
[http://IP_SERVEUR/files/progress?upload_id=1174642904]

Processing FilesController#progress (for my_IP at 2007-03-23 10:43:02)
[POST]
Parameters: {“action”=>“progress”, “controller”=>“files”,
“upload_id”=>“1174642904”}
1174642904
Completed in 0.00892 (112 reqs/sec) | Rendering: 0.00858 (96%) | DB:
0.00000 (0%) | 200 OK
[http://IP_SERVEUR/files/progress?upload_id=1174642904]

Processing FilesController#progress (for my_IP at 2007-03-23 10:43:05)
[POST]
Parameters: {“action”=>“progress”, “controller”=>“files”,
“upload_id”=>“1174642904”}
1174642904
Completed in 0.00581 (172 reqs/sec) | Rendering: 0.00558 (96%) | DB:
0.00000 (0%) | 200 OK
[http://IP_SERVEUR/files/progress?upload_id=1174642904]

Processing FilesController#progress (for my_IP at 2007-03-23 10:43:08)
[POST]
Parameters: {“action”=>“progress”, “controller”=>“files”,
“upload_id”=>“1174642904”}
1174642904
Completed in 0.00578 (173 reqs/sec) | Rendering: 0.00556 (96%) | DB:
0.00000 (0%) | 200 OK
[http://IP_SERVEUR/files/progress?upload_id=1174642904]

Processing FilesController#upload (for my_IP at 2007-03-23 10:43:09)
[POST]
Session ID: 85a4fa5dc5f0c442742c393746455108
Parameters: {“commit”=>“Upload”, “action”=>“upload”,
“controller”=>“files”, “upload_id”=>“1174642904”,
“data”=>#<File:/tmp/CGI.6545.0>}
Completed in 0.00026 (3862 reqs/sec) | Rendering: 0.00006 (22%) | DB:
0.00000 (0%) | 200 OK
[http://IP_SERVEUR/files/upload?upload_id=1174642904]

The @status is always nil.

I don’t know what ito do, is anyone have this problem before ?

Thanks for your help.

Seb.

ps: sorry for my english …


#2

hello,

the problem is solved.
The solution is to turn off the apache mod_security…

bye