views:

969

answers:

4

We want to implement a progress bar for file uploading in one of our Ruby application. This needs to show the exact percentage of the upload. However, despite our best efforts we could not find a way to implement a progress bar that exactly replicate the file upload process.

Can you please help us with this?

+1  A: 

If your are using Apache and Passenger, you can use the Apache progress bar module.

Screencast: http://www.railsillustrated.com/screencast-file-uploads-progress-in-rails-passenger.html

Apache Module and installation instructions: http://drogomir.com/blog/2008/6/18/upload-progress-bar-with-mod_passenger-and-apache

Rishav Rastogi
We are using Mongrel.
Aditya
People don't use Mongrel in Production anyway, you would probably end up using Nginx and Mongrel Clusters. In any case, I think there are plugins for Mongrel as well As Nginx. I haven't tried it using Mongrel but as always "Google is your friend" or try at the irc #rubyonrails
Rishav Rastogi
A: 

I have used mongrel_upload_progress in the past, but I found that it was quite a complex and delicate solution to the problem. I'd definitly recommend looking towards using passenger thru apache for your production environment, though.

Mr. Matt
+1  A: 

Found a good solution here http://bit.ly/1uTfrN check it out

Non-shortened URL is http://blog.dhavalparikh.co.in/2009/04/progress-bar-in-rails/
RichH
A: 

This was my crack at it, although I imagine your problem may be in knowing the file size?

http://software-testing.com.au/blog/2010/01/13/text-based-progress-bar-in-ruby-for-command-line-programs/

JaredQ