[Mongrel] Definitive guide for upload progress

Eugenol eugenol at gmail.com
Mon Dec 25 09:30:50 EST 2006


Is there some definitive guide for upload progress plugin ? We have in
this mailing list a lot of testimonials, bug reports, bug fixes, but
there are still people like me who cannot use it correctly.

Here is my config:
- mongrel 1.0RC and upload progress plugin 0.2.1
- a 6 mongrels cluster
- config/mongrel_upload_progress.conf:

uri "/",
  :handler => plugin("/handlers/upload",
    :path_info => '/upload/index',
    :frequency => 1,
    :drb => 'druby://'),
  :in_front => true

- After each cap deployment I manually  launch ruby
www/current/lib/upload.rb (yes that sucks)

require 'rubygems'
require 'fastthread'
require 'drb'
require 'gem_plugin'
GemPlugin::Manager.instance.load 'mongrel' => GemPlugin::INCLUDE
DRb.start_service 'druby://', Mongrel::UploadProgress.new

And all I get during upload ajax process are raised errors: "A
NameError occurred in upload#progress: uninitialized constant
Mongrel::Uploads". Status remains at 0% and picture is uploaded.

The DRb client always lists an empty array during uploads (get_status.list).

And in the rails controller I tried:
  def progress
    render :update do |page|
      @status = Mongrel::Uploads.instance.check(params[:upload_id])
@status['received']) if @status

as well as the "original"

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

Any idea ?

Thanks for your help

More information about the Mongrel-users mailing list