How to implement a progress bar in Ruby?

江枫思渺然 提交于 2019-12-10 20:33:59

问题


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:


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




回答2:


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.



来源:https://stackoverflow.com/questions/1141554/how-to-implement-a-progress-bar-in-ruby

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!