tag:railsillustrated.com,2009:/screencast-file-uploads-progress-in-rails-passenger/feedComments on „Screencast : How to Create a File Upload Progress Bar in Rails, Passenger, Prototype and Low Pro“ Rails Ill.railsillustrated.com/screencast-file-uploads-progress-in-rails-passenger.html2010-03-04T13:40:11Ztag:railsillustrated.com,2009-03-03:/screencast-file-uploads-progress-in-rails-passenger/comments/12314916342009-01-09T09:00:34ZRoy van der Meij said on January 9 2009
Nice solution.
Really clean and simple, I like it! Roy van der Meijtag:railsillustrated.com,2009-03-03:/screencast-file-uploads-progress-in-rails-passenger/comments/12316187132009-01-10T20:18:33ZJeff said on January 10 2009
I am curious as to how you slowed down the bandwidth on your local machine to simulate the progress?
Cool solution! Jefftag:railsillustrated.com,2009-03-03:/screencast-file-uploads-progress-in-rails-passenger/comments/12316873522009-01-11T15:22:32ZErik said on January 11 2009
Jeff - To slow down your bandwidth use these instructions here: [How to Simulate a Web Experience in Development](http://www.railsillustrated.com/simulating-a-web-experience.html). Basically you use `ipfw` to set a bandwidth limit to port 80. Erikhttp://railsillustrated.comtag:railsillustrated.com,2009-03-03:/screencast-file-uploads-progress-in-rails-passenger/comments/12319670632009-01-14T21:04:23ZDaniel said on January 14 2009
Wow, really cool! I just did a little hack job of a write up for multiple file uploads similar to Gmail's attachment feature.
Check it out here: <http://prowestech.com/posts/4>
When I get time, maybe I'll apply your methodology to my tutorial and see where it goes. Danielhttp://prowestech.comtag:railsillustrated.com,2009-03-03:/screencast-file-uploads-progress-in-rails-passenger/comments/12329895982009-01-26T17:06:38Zwout said on January 26 2009
Great screencast, thanx for that.
I implemented it into a project and it works very smooth, even with multiple files.
In IE7 (and IE6 too, but I'm not taking that beast into account) a new window opens when I start uploading. I guess IE doesn't get the concept op the dynamically created iframe?
Any suggestions on how to fix that? wouthttp://wonderingboys.comtag:railsillustrated.com,2009-03-03:/screencast-file-uploads-progress-in-rails-passenger/comments/12330790702009-01-27T17:57:50ZErik said on January 27 2009
wout - It seems like the `iframe` was not correctly inserted in IE. To get it to work in IE insert the `iframe` with:
$$("body").first().insert({bottom: "<iframe name='progressFrame' style='display:none; width:0; height:0; position: absolute; top:30000px;'></iframe>"});
Erikhttp://railsillustrated.comtag:railsillustrated.com,2009-03-03:/screencast-file-uploads-progress-in-rails-passenger/comments/12334275922009-01-31T18:46:32Zwout said on January 31 2009
Wow, thanx. Escaping it does the job indeed.
In the meanwhile I noticed something else though. If a visitor stops in the middle of an upload process, the apache progress module stops working. In some way this keeps paperclip from working too. The only way to get it working again is restarting apache.
At first I thought it was a local problem, but when I deployed the app on my mediatemple DV, the same thing happened. Later I tried it on the osx server of a client but without success. I'll notify drogus about it. wouthttp://wonderingboys.comtag:railsillustrated.com,2009-03-03:/screencast-file-uploads-progress-in-rails-passenger/comments/12337831062009-02-04T21:31:46Zerik said on February 4 2009
wout - That sounds a little odd. Are you submitting a single form with multiple file fields? You will want to have a separated submit with a separate and distinct uid for each submit. Another thing to consider to try to debug the situation if you haven't already tried this is to use the [Firefox Firebug extension](http://getfirebug.com/) to watch the requests and responses from the apache module. erikhttp://railsillustrated.comtag:railsillustrated.com,2009-03-03:/screencast-file-uploads-progress-in-rails-passenger/comments/12348300992009-02-17T00:21:39Zraphael_999 said on February 17 2009
for an odd reason i can't get the script to move on to the show action after the upload. It uploads, then the bar reaches 100% then it gets stuck there. The requests keeps on going with the state done. The show action is displayed in the iframe. I must be missing something huge. I hacked my way around it in the upload.js doing :
<pre><code>if(upload.state == 'uploading'){
upload.percent = Math.floor((upload.received / upload.size) * 100);
$('bar').setStyle({width: upload.percent + "%"});
$('bar').update(upload.percent + "%");
} else if (upload.state == 'done'){
redirect somewhere
}
</code></pre>
but i'm sure there's a cleaner way to do this.
plz keep in mind i'm quite noob with this rails thing. maybe i'm just asking too much to the rails magic ! :) raphael_999tag:railsillustrated.com,2009-03-03:/screencast-file-uploads-progress-in-rails-passenger/comments/12348578182009-02-17T08:03:38ZAmit Yadav said on February 17 2009
hi,
The "/progress" url is showing me a 404 error. Can anybody help me on that. Amit Yadavhttp://amityadav.nametag:railsillustrated.com,2009-03-03:/screencast-file-uploads-progress-in-rails-passenger/comments/12354729122009-02-24T10:55:12ZRoger S said on February 24 2009
Anyone get this working with nginx?? Roger Stag:railsillustrated.com,2009-03-03:/screencast-file-uploads-progress-in-rails-passenger/comments/12355283992009-02-25T02:19:59Zerik said on February 25 2009
**Roger S**: Are you using this module: [http://wiki.codemongers.com/NginxHttpUploadProgressModule](http://wiki.codemongers.com/NginxHttpUploadProgressModule). Is the JSON returned by the /progress URL in the same format? It might be slightly different. If it is, you might need to modify the Javascript that calculates the progress bar size.
**Amit**: Are you sure that Apache is configured correctly? You might want to double check the vhost config file and make sure that the Apache Module is activated in the `httpd.conf` file.
**raphael_999**: The Javascript should be loaded by the show action inside the `iframe`. The Javascript detects if the content of the `iframe` has been reloaded and then forces the parent to reload. This should cause the whole page to reload when the upload is complete, eriktag:railsillustrated.com,2009-03-03:/screencast-file-uploads-progress-in-rails-passenger/comments/12356993942009-02-27T01:49:54Znap said on February 27 2009
Hmm seems like this won't work with a standard new/edit form, since it's forcing a hard redirect to the submit action URL in the onLoad. Any ideas for making it play nice with edit forms and display errors inline?
In other words, instead of redisplaying the form data at /images/new (if there was a full form for data entry) it would redirect to /images and display the listing. naptag:railsillustrated.com,2009-03-03:/screencast-file-uploads-progress-in-rails-passenger/comments/12360702412009-03-03T08:50:41ZAlexwebmaster said on March 3 2009
Hello webmaster
I would like to share with you a link to your site
write me here preonrelt@mail.ru Alexwebmastertag:railsillustrated.com,2009-03-03:/screencast-file-uploads-progress-in-rails-passenger/comments/12373066752009-03-17T16:17:55ZJonathan said on March 17 2009
I'm receiving the "no suitable image" error even after following your instructions on compiling the apache upload progress module for my mac os x intel arch.
[http://gist.github.com/80611](http://gist.github.com/80611)
After closely examining your screencast, the only difference I see in my results and yours is this line:
<pre>
warning: no debug symbols in executable (-arch x86_64)</pre>
but its only a warning so I don't see how that could the culprit.
I'm using darwin ports apache: apache2 @2.2.11_0+darwin_9 (active)
Any suggestions? Jonathanhttp://blog.jonathanrwallace.comtag:railsillustrated.com,2009-03-03:/screencast-file-uploads-progress-in-rails-passenger/comments/12373131982009-03-17T18:06:38ZJonathan said on March 17 2009
Did my previous comment get eaten?
I followe your installation steps on mac os x intel arch and am still having problems.
[http://gist.github.com/80611](http://gist.github.com/80611)
Any suggestions? Jonathanhttp://blog.jonathanrwallace.comtag:railsillustrated.com,2009-03-03:/screencast-file-uploads-progress-in-rails-passenger/comments/12373440342009-03-18T02:40:34ZErik said on March 18 2009
**Jonathan** - it seems from your gist that it is still compiling a mach architecture version of `mod_upload_progress.so`. What version of gcc do you have installed? On my machine I have the version that was installed with XCode. Also are you using Tiger or Leopard? Erikhttp://railsillustrated.comtag:railsillustrated.com,2009-03-03:/screencast-file-uploads-progress-in-rails-passenger/comments/12374838512009-03-19T17:30:51ZJonathan said on March 19 2009
my gcc version is: `i686-apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5490)`
and i'm on leopard:
`ProductName: Mac OS X
ProductVersion: 10.5.6
BuildVersion: 9G55` Jonathanhttp://blog.jonathanrwallace.comtag:railsillustrated.com,2009-03-03:/screencast-file-uploads-progress-in-rails-passenger/comments/12380877412009-03-26T17:15:41ZJose said on March 26 2009
Hi!
Great and easy-to-follow video.
I installed FireBug and when I load the page I get the following error:
<b>Event.addBehavior is not a function</b>
Of course the whole system does not work at all, it does not even display the hidden div when submit is clicked.
Is there any extra javascript that needs to be included? Other suggestions to try and fix this?
Thank you.
Josetag:railsillustrated.com,2009-03-03:/screencast-file-uploads-progress-in-rails-passenger/comments/12380890972009-03-26T17:38:17ZJose said on March 26 2009
I reply to myself.
"lowpro.js" must be included as well.
Sorry for the post.
Josetag:railsillustrated.com,2009-03-03:/screencast-file-uploads-progress-in-rails-passenger/comments/12386072912009-04-01T17:34:51ZJonathan said on April 1 2009
Over at [Drogomir's blog](http://drogomir.com/blog/2008/6/18/upload-progress-bar-with-mod_passenger-and-apache) in the comments, I found a apxs command that worked for compiling the apache upload progress module.
<code>
sudo apxs -c -i -Wc,-arch -Wc,ppc7400 -Wl,-arch -Wl,ppc7400 -Wc,-arch -Wc,ppc64 -Wl,-arch -Wl,ppc64 -Wc,-arch -Wc,x86_64 -Wl,-arch -Wl,x86_64 -Wc,-arch -Wc,i386 -Wl,-arch -Wl,i386 mod_upload_progress.c
</code>
Thanks for the tutorial! Jonathanhttp://blog.jonathanrwallace.comtag:railsillustrated.com,2009-03-03:/screencast-file-uploads-progress-in-rails-passenger/comments/12397701792009-04-15T04:36:19ZGrant said on April 15 2009
Hmm.... I'm having all sorts of bother with this. Something is borked with my setup. Upload works fine (ie 100% uploaded immediately) without throttling, but no progress is shown {as expected}.
If I throttle using your instructions (ipfw), then upload takes forever {also expected?}. I confirm that I have had success twice {with firefox}, but now the progress bar updates in one jump after 15+ seconds. Same behavior with firefox 3.0.8 + Safari
Running OS 10.5.6/Apache2.2.9 with: Passenger 2.1.3. Safari 3.2.1, latest version of 'upload progress', Passenger Pref pane 1.2
I've tried Rails 2.1.0, and 2.1.2, no difference...
I've upgraded to Prototype 1.6.0.3 (from 1.6.0.1) no difference
Qs:
- What version of Safari are you using?
- What version of Passenger are you using?
- Does the <directory> directive inside the VirtualHost require a Capital 'D' ?
- Have you got it to work with Passenger.pref pane?
Maybe important: ruby+gem+rails installed using MacPorts (ie in /opt/local/....)
Suggestions, anyone?
Thank you.
Granttag:railsillustrated.com,2009-03-03:/screencast-file-uploads-progress-in-rails-passenger/comments/12476378102009-07-15T06:03:30ZLeumas said on July 15 2009
Good work Eric!!!
Two Things:
1) Is there a method to see if the upload_module is properly installed / configuration is correct.
2) I am not sure if I connected the javascript libraries correctly... connected prototype and lowpro in the right way. I downloaded lowpro.js and prototype.js, and included both of them in the layout declaring prototype first.
best,
Leumas Leumashttp://laowise.comtag:railsillustrated.com,2009-03-03:/screencast-file-uploads-progress-in-rails-passenger/comments/12476399012009-07-15T06:38:21ZLeumas said on July 15 2009
Forget to ask a question regarding my last post.
The question for number 2) is is there a method to check if they javascript files are installed correctly?
Leuams Leumashttp://beginnercasts.comtag:railsillustrated.com,2009-03-03:/screencast-file-uploads-progress-in-rails-passenger/comments/12489641062009-07-30T14:28:26Ziuser59 said on July 30 2009
This is what I have
http://pastie.org/private/x4yfvdc9fpksi4lwgtylha
It seems to be the same problem than Jonathan
Someone can help? iuser59tag:railsillustrated.com,2009-03-03:/screencast-file-uploads-progress-in-rails-passenger/comments/12489659672009-07-30T14:59:27Ziuser59 said on July 30 2009
This is what I have when I include lowpro.js
http://pastie.org/565370 iuser59tag:railsillustrated.com,2009-03-03:/screencast-file-uploads-progress-in-rails-passenger/comments/12493109142009-08-03T14:48:34ZJonathan said on August 3 2009
Leumas,
Lowpro requires prototype. Try including that. I don't see it in your pastie.
Jonathanhttp://blog.jonathanrwallace.comtag:railsillustrated.com,2009-03-03:/screencast-file-uploads-progress-in-rails-passenger/comments/12497176382009-08-08T07:47:18ZLeumas said on August 8 2009
Thanks, for the help. Been waiting a while and I will see if those tips work.
Best,
Leumas Leumashttp://www.laowise.comtag:railsillustrated.com,2009-03-03:/screencast-file-uploads-progress-in-rails-passenger/comments/12506173152009-08-18T17:41:55ZEH said on August 18 2009
Does this video really only have 10 keyframes? EHtag:railsillustrated.com,2009-03-03:/screencast-file-uploads-progress-in-rails-passenger/comments/12514706762009-08-28T14:44:36ZNico said on August 28 2009
Anyone using Amazon S3 who is interested in uploading multiple files (with progress bars, simultaneously) directly to S3 without hitting the server might be interested in my posts here:
http://www.railstoolkit.com/posts/fancyupload-amazon-s3-uploader-with-paperclip
http://www.railstoolkit.com/posts/uploading-files-directly-to-amazon-s3-using-fancyupload Nicohttp://nicoritsche.comtag:railsillustrated.com,2009-03-03:/screencast-file-uploads-progress-in-rails-passenger/comments/12665066382010-02-18T15:23:58Znurbs999 said on February 18 2010
Nice tutorial, it works, but my flash notices aren't displayed even though they are in my index-layout.
any hints for that? nurbs999tag:railsillustrated.com,2009-03-03:/screencast-file-uploads-progress-in-rails-passenger/comments/12668707822010-02-22T20:33:02ZBrad said on February 22 2010
Thanks for the work. It was a great help.
Is anyone else having problems with the progress bar updating in Webkit based broswers. I've tried both Chrome and Safari. Firefox & IE both work perfectly.
I have modified the form & controller, but I've left the JavaScript in tact from the example above. Any ideas? Bradtag:railsillustrated.com,2009-03-03:/screencast-file-uploads-progress-in-rails-passenger/comments/12677100112010-03-04T13:40:11ZMarc said on March 4 2010
I'm trying to install this on a dreamhost server and it doesn't want to install the module. When I do the second step with the 'apxs' command it says it doesn't know that command… how can i install this on a remote server?
Thanks. Marchttp://marclipovsky.com