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

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

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.

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. [email protected] wrote:

Uploading files works fine, but unfortunately no progress is shown. When
Mischa.


Posted via http://www.ruby-forum.com/.


Matt W.

Thermal Creative
http://blog.thermalcreative.com

Whoops, my bad… ServiceCapture:
http://kevinlangdon.com/serviceCapture/

Matt

On 11/26/06, Matt W. [email protected] 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


Matt W.

Thermal Creative
http://blog.thermalcreative.com

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.

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 :slight_smile:

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

Matt

On 11/27/06, Mischa B. [email protected] wrote:

Posted via http://www.ruby-forum.com/.


Matt W.

Thermal Creative
http://blog.thermalcreative.com

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.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs