Upload Progress Bar not showing


#1

Hi. I’m setting up an upload form for internal users of a Rails site,
and I’m trying to use the Upload Progress Bar plugin from
http://sean.treadway.info/demo/upload/. I followed the directions as set
out in the Rails Wiki
(http://wiki.rubyonrails.org/rails/pages/Upload+Progress+Bar).

Basically the problem is no progress bar or any upload information shows
up. In WEBrick, I just get “Upload starting…” and then “Upload
finished” after which the page gets redirected as I have it set up in
the view.

I also have my Rails application set up for Apache, so when I try the
same thing, upload a file, I get the same message, “Upload starting…”
then “Upload finished”, only I don’t get a redirect and the file I
uploaded isn’t there.

This is what my uploads controller looks like:

class UploadsController < ApplicationController
before_filter :authorize
upload_status_for :new

[…]

def new
if request.get?
@upload = Upload.new
else
@upload = Upload.new(@params[“upload”])
if @upload.save
flash[:notice] = “File uploaded sueccessfully.”
redirect_to :action => “list”
end
end
end
end

And the ‘new’ upload view:

Upload File

<%= form_tag_with_upload_progress %>

<%= render :partial => ‘upload_form’ %>

<%= upload_status_tag %>

<%= link_to '« Show All Uploads', :action => 'list_uploads' %>

Also, if this affects the uploading progress bar process, in my model
I’m specifying that I’ll have the upload saved in the filesystem. Here
is what the ‘upload’ model looks like:

class Upload < ActiveRecord::Base
has_one :movie
belongs_to :movie

def file=(upload_file)
File.open(“files/#{upload_file.original_filename}”, “w”) { |f|
f.write(upload_file.read) }
self.filename = upload_file.original_filename
self.content_type = upload_file.content_type
self.size = upload_file.size.to_s
end

def before_destroy
File.delete(“files/#{self.filename}”)
end

def file_data
IO.read(“files/#{self.filename}”)
end
end

For the reference, I’m on DreamHost, using Apache 1.3, Ruby 1.8.2, and
Ruby on Rails 1.1 (I have it installed in vendors/rails-1.1). Any help
on this would be much appreciated. Thanks.

-Jon


#2

Jon G. wrote:

Hi. I’m setting up an upload form for internal users of a Rails site,
and I’m trying to use the Upload Progress Bar plugin from
http://sean.treadway.info/demo/upload/. I followed the directions as set
out in the Rails Wiki
(http://wiki.rubyonrails.org/rails/pages/Upload+Progress+Bar).

Hi Jon

Jon have u checked that sean teadways checklist link on that progress
bar’s link u have specified.

First see checklist is shows the basic environment need to work progress
bar properly

  • Pratiksha

#3

Did you get the progress bar work??

HItesh

On Sep 23 2006, 6:52 pm, Pratiksha G. <rails-mailing-l…@andreas-