Re: Upload_progress questions

Matt Pelletier
Thu, 19 May 2005 07:04:37 -0000

jason lynes :: senyl.com wrote:
> I''m trying to implement this feature:
> http://sean.treadway.info/demo/upload, but am missing what they''re
> assuming i should know beforehand.  Can someone provide some steps to
> getting this to work?  I''ve been tinkering with the
upload_progress.rb
> file, but am finding no instructions on how to include this or make it
> work.  Thanks!
>

Hey senyl.

First, you should checkout the Rails trunk into your
/RAILS_ROOT/vendor/rails, because the required changes are not yet part
of the trunk. At least they weren''t when I tried it, shortly after
0.12.1 came out. If you haven''t done this read "Edge Rails"
(links below).

Next, get the DIFF from the Trac ticket and patch your Rails trunk with
it. It will probably have errors when it gets to the
raw_post_data_fix.rb, and maybe one other place. This is because the
DIFF from the ticket was generated from a pre-0.12.1 trunk, and 0.12.1
made some minor changes of its own to that file. Just take a look at the
details and tweak it by hand. Additional changes may have been made to
this and other files affected by the DIFF, so caveat emptor (or,
programor, if you will).

This should get it working. To make it look nice, you''ll need to grab
the CSS and two images used in the demo. It looks like it may no longer
be an issue, but when I tried this I had to grab the prototype.js from
the online demo, because the one included with Rails 0.12.1 wasn''t
doing
the trick. At the time the online demo''s version stated it was 1.2.1
(found near the top of the .js), but the version now used in the online
demo is 1.2.0, the same included with rails. So perhaps something was
changed under the radar. Just use the prototype.js you have to start,
and if the progress meter doesn''t appear to work properly
(aesthetically, that is), investigate.

Good luck,

Matt (bricolage)

[Edge Rails]
http://wiki.rubyonrails.com/rails/show/EdgeRails
[Trac Ticket 1026]
http://dev.rubyonrails.com/ticket/1026
[DIFF from Ticket] (listed in the ticket history)
http://dev.rubyonrails.com/attachment/ticket/1026/upload_progress_1201-1.diff
[CSS and images]