Mongrel_upload_progress issues

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)
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

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