# Mongrel\_upload\_progress issues

**URL:** <https://www.ruby-forum.com/t/mongrel-upload-progress-issues/134753>\
**Category:** Rails\
**Created:** [April 14, 2008, 8:28pm UTC](https://www.ruby-forum.com/t/mongrel-upload-progress-issues/134753 "2008-04-14T20:28:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mr\_tibs](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/439d5e/32.png) [@mr\_tibs](https://www.ruby-forum.com/u/mr_tibs)\
**Post date:** [April 14, 2008, 8:28pm UTC](https://www.ruby-forum.com/t/mongrel-upload-progress-issues/134753/1 "2008-04-14T20:28:53Z")

</div>

Hi,

I’ve been trying to use the mongrel\_upload\_progress gem to implement a  
file upload progress indicator. The progress bar doesn’t work properly:  
it starts at 0% and it jumps to 100%.

I realized this is because the progress() function in the controller  
([http://mongrel.rubyforge.org/attachment/wiki/UploadProgress/files\_controller.rb](http://mongrel.rubyforge.org/attachment/wiki/UploadProgress/files_controller.rb))  
does get periodically called, but the @status object is nil. I think the  
@status object contains the current upload data. That is because nobody  
is calling the Mongrel::Uploads.add(upid, size) function at the start of  
the download. It is this function which initializes @status. I added  
that as a new AJAX call, however, I don’t know where to get the size  
from (so I hard-coded it for now). Even like this, it doesn’t work 100%  
well. Now I do see a new line that says “X bytes of XMB uploaded”, but  
the progress bar is still not being incremented. You might say that the  
upload is too fast: not true; I tried different sizes with different  
connections.

My question is: did anyone manage to get this mongrel\_upload\_progress to  
work successfully? What kind of modifications to the sample files did  
you make? Is this really used in production by anyone?

Thanks,  
Tiberiu
