Class: Upload

### Home Classes Methods

### In Files

- lib/mongrel_upload_progress/init.rb

### Parent

GemPlugin::Plugin"/handlers"

### Methods

- ::new
- #process
- #request_begins
- #request_progress

### Included Modules

- Mongrel::HttpHandlerPlugin

### Class/Module Index

Quicksearch

- Mongrel
- Mongrel::UploadProgress
- Upload

No matching classes.

# Upload

### Public Class Methods

new(options = {}) click to toggle source

    # File lib/mongrel_upload_progress/init.rb, line 7
    def initialize(options = {})
      @path_info      = Array(options[:path_info])
      @frequency      = options[:frequency] || 3
      @request_notify = true
      if options[:drb]
        require 'drb'
        DRb.start_service
        Mongrel.const_set :Uploads, DRbObject.new(nil, options[:drb])
      else
        Mongrel.const_set :Uploads, Mongrel::UploadProgress.new
      end
      Mongrel::Uploads.debug = true if options[:debug]
    end

### Public Instance Methods

process(request, response) click to toggle source

    # File lib/mongrel_upload_progress/init.rb, line 29
    def process(request, response)
      upload_notify(:finish, request.params)
    end

request_begins(params) click to toggle source

    # File lib/mongrel_upload_progress/init.rb, line 21
    def request_begins(params)
      upload_notify(:add, params, params[Mongrel::Const::CONTENT_LENGTH].to_i)
    end

request_progress(params, clen, total) click to toggle source

    # File lib/mongrel_upload_progress/init.rb, line 25
    def request_progress(params, clen, total)
      upload_notify(:mark, params, clen)
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.