[Mongrel] mongrel_upload_progress question/possible suggestion
stockliasteroid at gmail.com
Mon Nov 13 02:57:48 EST 2006
First off, thanks to Rick Olson and whoever else was involved with this
plugin... It's been amazingly easy to implement.
I've got a question about the path_info parameter, though... It seems that
unless the request PATH_INFO exactly matches the path_info passed in to the
plugin at inclusion, it won't actually trigger Add and add the upload to the
list of running transfers. I'm assuming that this is for performance
reasons, and makes good sense. However, I'm in a situation where I don't
know the exact path that I will b e uploading from, because of various
routing info in my app.
Thus, the ability for path_info to be a regex instead of just a string, thus
return unless params['PATH_INFO'] =~ @path_info &&
params[Mongrel::Const::REQUEST_METHOD] == 'POST' &&
upload_id = Mongrel::HttpRequest.query_parse
Then I just update my handler like so:
:handler => plugin("/handlers/upload", :path_info =>
:in_front => true
And everything works fine... It's a super-small tweak, obviously, but I
found that it made it a lot easier for me to use the plugin.
Thoughts? Is there a better way to do this?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Mongrel-users