I''ve not been able to get upload progress with Mongrel working after following the instructions here: http://mongrel.rubyforge.org/docs/upload_progress.html "Mongrel::Uploads.check(params[:upload_id]) " always returns nil even during a very large upload. Everything else in my test app is working fine, the file uploads fine, just can''t get the progress from Mongrel. I''m running in development mode (not using the cluster method yet) uri "/", :handler => plugin("/handlers/upload", :path_info => ''/files/ upload''), :in_front => true My environment is: OS X Rails 1.2.2 Mongrel 0.3.13.3 Mongrel upload progress plugin: 0.2.1 I''d also like to know people''s opinions on if this is even realistic with Mongrel for a production site. Might I run in to problems if multiple people are uploading at the same time since in the production cluster situation, a single process has to be responsible for all the uploads so Its progress as described in that tutorial.? I am considering using a Flash approach instead with the new FileReference feature. Many thanks David North --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Peter De Berdt
2007-Feb-26 15:18 UTC
Re: Upload progress with Mongrel doesn''t work in dev mode
On 26 Feb 2007, at 16:07, David North wrote:> I am considering using a Flash approach instead with the new > FileReference feature.I would also recommend using a Flash-based approach, you''ll avoid having to deal with things serverside and it always works. I''ve implemented SWFUpload (http://swfupload.mammon.se/) for "AJAX upload with progress feedback" and it works just great, once know a few small things to look out for. It not only provides you with progress feedback, but will also allow you to limit file size, file types and multiple file selection, all client side. It needs Flash 8 installed, but that shouldn''t really be a problem nowadays, where Flash is pretty common. If you would like access to one of my Rails apps using SWFUpload so you can see how it works in a Rails environment, contact me offlist. Best regards Peter De Berdt --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
PeteDeLaurentis
2007-Feb-26 17:09 UTC
Re: Upload progress with Mongrel doesn''t work in dev mode
Hi David, I just fought through this and got this working last week. I had the same issue where it returned nil for a while. It was some work, but well worth it because it''s portable to Flash and AJAX implementations. Also, you can show upload progress not just to the guy uploading the file, but to anyone who might be waiting to see it (this was a need for us since we have a chat system). Some things to check: 1. Double check the URL you''re uploading to from the FileReference. It must have an upload_id parameter in it. 2. Where are you querying for Mongrel::Uploads.check? 3. Check for any specific routings in routes.rb mentioning your upload action, and try removing them these can sometimes mess up the upload_id syntax (this is the one that stumped me for a while) Here''s a sample of the URL I uploaded to: // The listener object listens for FileReference events. var listener:Object = new Object(); // This event gets called when the user selects a file listener.onSelect = function(selectedFile:FileReference):Void { // Once we get the resource back, we''ll do the upload selectedFile.upload(me.url + "/file/flash_upload?upload_id=" + resource.id.toString()); } // Create a new file reference which we''ll use to do the uploading var uploader:FileReference = new FileReference(); uploader.addListener(listener); // Start the process by browsing for the file in question uploader.browse([{description: "All Files", extension: "*.*"}]); Hope this helps, Pete David North wrote:> I''ve not been able to get upload progress with Mongrel working after > following the instructions here: http://mongrel.rubyforge.org/docs/upload_progress.html > > "Mongrel::Uploads.check(params[:upload_id]) " always returns nil even > during a very large upload. Everything else in my test app is working > fine, the file uploads fine, just can''t get the progress from Mongrel. > > I''m running in development mode (not using the cluster method yet) > uri "/", > :handler => plugin("/handlers/upload", :path_info => ''/files/ > upload''), > :in_front => true > > > My environment is: > > OS X > Rails 1.2.2 > Mongrel 0.3.13.3 > Mongrel upload progress plugin: 0.2.1 > > I''d also like to know people''s opinions on if this is even realistic > with Mongrel for a production site. Might I run in to problems if > multiple people are uploading at the same time since in the production > cluster situation, a single process has to be responsible for all the > uploads so Its progress as described in that tutorial.? > > I am considering using a Flash approach instead with the new > FileReference feature. > > Many thanks > > David North--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
David North
2007-Mar-12 12:02 UTC
Re: Upload progress with Mongrel doesn''t work in dev mode
Thanks for the suggestions I decided to go with Flash only and that works great except that I can''t get Flash''s POST upload request to maintain the session in Rails, even when passing through the right session_id in the querystring of the upload URL. http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/3416d885ecf2c59d David On Feb 26, 5:09 pm, "PeteDeLaurentis" <pete.delauren...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi David, > > I just fought through this and got this working last week. I had the > same issue where it returned nil for a while. It was some work, but > well worth it because it''s portable to Flash and AJAX > implementations. Also, you can show upload progress not just to the > guy uploading the file, but to anyone who might be waiting to see it > (this was a need for us since we have a chat system). > > Some things to check: > > 1. Double check the URL you''re uploading to from the FileReference. > It must have an upload_id parameter in it. > 2. Where are you querying for Mongrel::Uploads.check? > 3. Check for any specific routings in routes.rb mentioning your upload > action, and try removing them > these can sometimes mess up the upload_id syntax (this is the one > that stumped me for a while) > > Here''s a sample of the URL I uploaded to: > > // The listener object listens for FileReference events. > var listener:Object = new Object(); > > // This event gets called when the user selects a file > listener.onSelect = function(selectedFile:FileReference):Void { > // Once we get the resource back, we''ll do the upload > selectedFile.upload(me.url + "/file/flash_upload?upload_id=" + > resource.id.toString()); > } > > // Create a new file reference which we''ll use to do the > uploading > var uploader:FileReference = new FileReference(); > uploader.addListener(listener); > > // Start the process by browsing for the file in question > uploader.browse([{description: "All Files", extension: "*.*"}]); > > Hope this helps, > Pete > > David North wrote: > > I''ve not been able to get upload progress with Mongrel working after > > following the instructions here: http://mongrel.rubyforge.org/docs/upload_progress.html > > > "Mongrel::Uploads.check(params[:upload_id]) " always returns nil even > > during a very large upload. Everything else in my test app is working > > fine, the file uploads fine, just can''t get the progress from Mongrel. > > > I''m running in development mode (not using the cluster method yet) > > uri "/", > > :handler => plugin("/handlers/upload", :path_info => ''/files/ > > upload''), > > :in_front => true > > > My environment is: > > > OS X > > Rails 1.2.2 > > Mongrel 0.3.13.3 > > Mongrel upload progress plugin: 0.2.1 > > > I''d also like to know people''s opinions on if this is even realistic > > with Mongrel for a production site. Might I run in to problems if > > multiple people are uploading at the same time since in the production > > cluster situation, a single process has to be responsible for all the > > uploads so Its progress as described in that tutorial.? > > > I am considering using a Flash approach instead with the new > > FileReference feature. > > > Many thanks > > > David North--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---