如何在 Ruby 中实现进度条?
我们想要在我们的 Ruby 应用程序之一中实现文件上传的进度条。 这需要显示上传的确切百分比。 然而,尽管我们尽了最大努力,我们还是找不到一种方法来实现完全复制文件上传过程的进度条。
您能帮我们解决这个问题吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您使用 Apache 和 Passenger,则可以使用 Apache 进度条模块。
截屏视频:
http://www.railsillusterated.com/screencast- file-uploads-progress-in-rails-passenger.html
Apache 模块和安装说明:
http://drogomir.com/博客/2008/6/18/upload-progress-bar-with-mod_passenger-and-apache
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
我过去曾使用过 mongrel_upload_progress ,但我发现这是一个相当复杂且微妙的问题解决方案。 不过,我绝对建议您在生产环境中通过 apache 使用乘客。
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.