# Mongrel upload progress jumps from 0% to 100% (no progress)

**URL:** <https://www.ruby-forum.com/t/mongrel-upload-progress-jumps-from-0-to-100-no-progress/77272>\
**Category:** Rails\
**Created:** [November 25, 2006, 8:55pm UTC](https://www.ruby-forum.com/t/mongrel-upload-progress-jumps-from-0-to-100-no-progress/77272 "2006-11-25T20:55:30Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![mischa78](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/3da27b/32.png) [@mischa78](https://www.ruby-forum.com/u/mischa78)\
**Post date:** [November 25, 2006, 8:55pm UTC](https://www.ruby-forum.com/t/mongrel-upload-progress-jumps-from-0-to-100-no-progress/77272/1 "2006-11-25T20:55:30Z")

</div>

Hi,

I’ve been trying to implement monrel upload progress, but I cannot get  
it to work properly. I hope someone here can help me.

I followed the instructions on this page:  
[http://mongrel.rubyforge.org/docs/upload\_progress.html](http://mongrel.rubyforge.org/docs/upload_progress.html)

Uploading files works fine, but unfortunately no progress is shown. When  
I start the upload the progress bar says 0%, when the upload is finished  
the progress bar jumps from 0% to 100% without showing progress in the  
mean time. I have no idea what I could be doing wrong. Has anyone here  
encountered the same problems?

I’m running OSX 10.4.8. Could that be the problem? I tried it with just  
Mongrel and with Mongrel + Apache, both behave the same way.

Any suggestions?? Thanks in advance.

Mischa.

---

<div class="post-metadata">

**Author:** ![mischa78](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/3da27b/32.png) [@mischa78](https://www.ruby-forum.com/u/mischa78)\
**Post date:** [November 26, 2006, 4:16am UTC](https://www.ruby-forum.com/t/mongrel-upload-progress-jumps-from-0-to-100-no-progress/77272/2 "2006-11-26T04:16:10Z")

</div>

Mischa,

This might be a REALLY stupid answer, but it’s the most obvious one…  
Are  
you testing locally only? If so, make sure that you throttle your  
bandwidth  
in some way (perhaps using ServiceMonitor) so that it simulates an  
upload  
with a bandwidth constraint. Otherwise the transfer will occur too fast  
for  
the upload\_progress to actually do anything.

I’m using mongrel\_upload\_progress without difficulty behind Pen +  
Apache, so  
Apache isn’t an issue. And it works fine in dev mode with Mongrel only.

If this doesn’t help (and I’m pretty sure it won’t ;), post some code so  
we  
can be of more help…

Matt

On 11/26/06, Mischa B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Uploading files works fine, but unfortunately no progress is shown. When  
> Mischa.
> 
> –  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
> 
> >

## – Matt W.

Thermal Creative  
[http://blog.thermalcreative.com](http://blog.thermalcreative.com)

---

<div class="post-metadata">

**Author:** ![mischa78](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/3da27b/32.png) [@mischa78](https://www.ruby-forum.com/u/mischa78)\
**Post date:** [November 26, 2006, 4:18am UTC](https://www.ruby-forum.com/t/mongrel-upload-progress-jumps-from-0-to-100-no-progress/77272/3 "2006-11-26T04:18:10Z")

</div>

Whoops, my bad… ServiceCapture:  
[http://kevinlangdon.com/serviceCapture/](http://kevinlangdon.com/serviceCapture/)

Matt

On 11/26/06, Matt W. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> so Apache isn’t an issue. And it works fine in dev mode with Mongrel only.
> 
> > encountered the same problems?
> > 
> > > >
> 
> ## – Matt W.
> 
> Thermal Creative  
> [http://blog.thermalcreative.com](http://blog.thermalcreative.com)

## – Matt W.

Thermal Creative  
[http://blog.thermalcreative.com](http://blog.thermalcreative.com)

---

<div class="post-metadata">

**Author:** ![mischa78](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/3da27b/32.png) [@mischa78](https://www.ruby-forum.com/u/mischa78)\
**Post date:** [November 26, 2006, 12:01pm UTC](https://www.ruby-forum.com/t/mongrel-upload-progress-jumps-from-0-to-100-no-progress/77272/4 "2006-11-26T12:01:16Z")

</div>

OK, I got it working… the solution was: sudo gem cleanup

I guess my controller was looking at some old code I used to try to get  
it working earlier.

Mischa.

---

<div class="post-metadata">

**Author:** ![mischa78](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/3da27b/32.png) [@mischa78](https://www.ruby-forum.com/u/mischa78)\
**Post date:** [December 27, 2006, 9:11am UTC](https://www.ruby-forum.com/t/mongrel-upload-progress-jumps-from-0-to-100-no-progress/77272/5 "2006-12-27T09:11:03Z")

</div>

Mischa B. wrote:

> OK, I got it working… the solution was: sudo gem cleanup
> 
> I guess my controller was looking at some old code I used to try to get  
> it working earlier.
> 
> Mischa.

We had the same problem, and we did gem clean up which didn’t help very  
much.  
the actual problem was that we didn’t use the same upload\_id in the form  
and the AJAX updater.

stupid 🙂

---

<div class="post-metadata">

**Author:** ![mischa78](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/3da27b/32.png) [@mischa78](https://www.ruby-forum.com/u/mischa78)\
**Post date:** [November 27, 2006, 1:38am UTC](https://www.ruby-forum.com/t/mongrel-upload-progress-jumps-from-0-to-100-no-progress/77272/6 "2006-11-27T01:38:16Z")

</div>

Interesting… Perhaps it was starting an old version of Mongrel or  
something. Glad you got it working!

Matt

On 11/27/06, Mischa B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
> 
> >

## – Matt W.

Thermal Creative  
[http://blog.thermalcreative.com](http://blog.thermalcreative.com)

---

<div class="post-metadata">

**Author:** ![mischa78](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/3da27b/32.png) [@mischa78](https://www.ruby-forum.com/u/mischa78)\
**Post date:** [November 26, 2006, 11:10am UTC](https://www.ruby-forum.com/t/mongrel-upload-progress-jumps-from-0-to-100-no-progress/77272/7 "2006-11-26T11:10:30Z")

</div>

Thanks Matt,

The error I’m getting is the following:

NoMethodError in FilesController#progress  
undefined method `check’ for Mongrel::Uploads:Class

this is what my controller looks like:

class FilesController \< ApplicationController  
session :off, :only =\> :progress

def progress  
render :update do |page|  
@status = Mongrel::Uploads.check(params[:upload\_id])  
page.upload\_progress.update(@status[:size], @status[:received]) if  
@status  
end  
end

def upload  
render :text =\> %(UPLOADED: #{params.inspect}.)  
end  
end

Do I need to require Mongrel or something??

Any ideas? As far a I can see I follow the instructions to the point,  
but I’m sure if missed something…

Thanks again.

Mischa.
