# mongrel\_upload\_progress issues

**URL:** <https://discuss.rubyonrails.org/t/mongrel-upload-progress-issues/27989>\
**Category:** rubyonrails-talk\
**Created:** [April 14, 2008, 6:28pm UTC](https://discuss.rubyonrails.org/t/mongrel-upload-progress-issues/27989 "2008-04-14T18:28:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![11175](https://avatars.discourse-cdn.com/v4/letter/1/8edcca/32.png) [@11175](https://discuss.rubyonrails.org/u/11175)\
**Post date:** [April 14, 2008, 6:28pm UTC](https://discuss.rubyonrails.org/t/mongrel-upload-progress-issues/27989/1 "2008-04-14T18: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
