I am getting this error in my mongrel.log whenever I try to upload a file in my rails application via a form. My model is using the File Column plugin (http://www.kanthak.net/opensource/file_column/). ------------------------------------------------------ ** Mongrel available at 127.0.0.1:8001 ** Writing PID file to log/mongrel.8001.pid ** Rails loaded. ** Loading any Rails specific GemPlugins ** Signals ready. TERM => stop. USR2 => restart. INT => stop (no restart). ** Rails signals registered. HUP => reload (without restart). It might not work well. ** Mongrel available at 127.0.0.1:8000 ** Writing PID file to log/mongrel.8000.pid ERROR reading http body: Socket read returned insufficient data: 6314 ERROR reading http body: Socket read returned insufficient data: 10410 ERROR reading http body: Socket read returned insufficient data: 11823 ERROR reading http body: Socket read returned insufficient data: 10582 ------------------------------------------------------ I don''t get this error when uploaded in development mode on my home machine, only in production mode on my live server. Any clues as to what this error means or how to resolve it? PS. I''m running Pound in front of a Mongrel cluster and Lighttpd server. Cheers, Mark -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hi there. Is there anyone, who can direct me to a site, that explains how to upload a file via RoR Im a beginner -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Emil Kampp wrote:> Hi there. > > Is there anyone, who can direct me to a site, that explains how to > upload a file via RoR > > Im a beginnerlook up file_column: http://www.kanthak.net/opensource/file_column/ i think there are other things out there (in fact, maybe even better) but i think this quite basic and good enough. hth, s -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
((ignore the Rmagik stuff in the meantime)) -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Other options are: acts_as_attachment: http://technoweenie.stikipad.com/plugins/show/Acts+as+Attachment or flex_image: http://beautifulpixel.textdriven.com/ Kind regards, Nick Snels -- http://railshostinginfo.com Compare and review Rails hosting -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
You can also put this kind of stuff in your controller (for example) or for DRY put it in your model... @file = params[:image][:img] if @file.original_filename.length > 0 filename = session[:dirname] + "/" + @file.original_filename File.open(filename, "w") { |f| f.write(@file.read) } end redirect_to :action => "index" Emil Kampp wrote:> Hi there. > > Is there anyone, who can direct me to a site, that explains how to > upload a file via RoR > > Im a beginner-- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Nicolas Blanco wrote:> You can also put this kind of stuff in your controller (for example) or > for DRY put it in your model... > > @file = params[:image][:img] > if @file.original_filename.length > 0 > filename = session[:dirname] + "/" + @file.original_filename > File.open(filename, "w") { |f| f.write(@file.read) } > end > redirect_to :action => "index" > >DRY ?? What is this ? - Emil -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On 1/16/07, Emil Kampp <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Nicolas Blanco wrote: > > You can also put this kind of stuff in your controller (for example) or > > for DRY put it in your model... > > > > @file = params[:image][:img] > > if @file.original_filename.length > 0 > > filename = session[:dirname] + "/" + @file.original_filename > > File.open(filename, "w") { |f| f.write(@file.read) } > > end > > redirect_to :action => "index" > > > > > > DRY ?? What is this ?DRY means Don''t Repeat Yourself, a common mantra for rails developers. For instance, using one of the above mentioned plugins means this will probably be taken care of for you. If you''re on rails 1.2 and were looking at acts_as_attachment, I''d suggest my refactored update attachment_fu. It has an #uploaded_data accessor that handles the above code in your model. -- Rick Olson http://weblog.techno-weenie.net http://mephistoblog.com --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Pradeep wrote:> Hi All, > > I also get the same error. Even in the development mode. Can anyone > help!! > > Cheers, > Pradeep. > > On Dec 20 2006, 4:00 am, Mark Dodwell <rails-mailing-l...@andreas-Hi - I got the same error on my live app. Got the call to say the site is down. Restarted mongrel and after clearing the PID it worked and al was well. I found the exact same error in the mongrel.log. Has anyone figured anything out? Ivor -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Ivor Paul wrote:> Pradeep wrote: >> Hi All, >> >> I also get the same error. Even in the development mode. Can anyone >> help!! >> >> Cheers, >> Pradeep. >> >> On Dec 20 2006, 4:00 am, Mark Dodwell <rails-mailing-l...@andreas- > > Hi - I got the same error on my live app. Got the call to say the site > is down. Restarted mongrel and after clearing the PID it worked and al > was well. > > I found the exact same error in the mongrel.log. > > Has anyone figured anything out? > > IvorI faced the same problem but thankfully I was able to get out of it. In my case, I was using a javacsript to submit the form that held the file field. When I used a normal submit button, it all started working fine. :-) I really dont know what exactly is wrong in submitting form using a javascript but using the submit button instead worked. You may want to try that... Chirantan. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
I''m facing the same problem and can''t figure out what''s going on! my form is submitted using submit button. Please I need your help in this urgently. On Nov 20, 1:54 pm, Chirantan Rajhans <rails-mailing-l...@andreas- s.net> wrote:> Ivor Paul wrote: > > Pradeep wrote: > >> Hi All, > > >> I also get the same error. Even in the development mode. Can anyone > >> help!! > > >> Cheers, > >> Pradeep. > > >> On Dec 20 2006, 4:00 am, Mark Dodwell <rails-mailing-l...@andreas- > > > Hi - I got the same error on my live app. Got the call to say the site > > is down. Restarted mongrel and after clearing the PID it worked and al > > was well. > > > I found the exact same error in the mongrel.log. > > > Has anyone figured anything out? > > > Ivor > > I faced the same problem but thankfully I was able to get out of it. > > In my case, I was using a javacsript to submit the form that held the > file field. When I used a normal submit button, it all started working > fine. :-) I really dont know what exactly is wrong in submitting form > using a javascript but using the submit button instead worked. > > You may want to try that... > > Chirantan. > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Tue, Dec 19, 2006 at 3:00 PM, Mark Dodwell <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> I don''t get this error when uploaded in development mode on my home > machine, only in production mode on my live server. > > Any clues as to what this error means or how to resolve it? > > PS. I''m running Pound in front of a Mongrel cluster and Lighttpd server.Are you running the same configuration in your dev environment? If not, can you try it, or alternatively try uploading directly to one of the mongrels (bypassing Pound/Lighttpd) in production? Seems like the first thing to try to eliminate from the equation :-) -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Friends. I got the same error... ERROR reading http body: Socket read returned insufficient data: After analysing it I goes to the result that in the mean time of the request data transfer the internet connect is lost from the client to the server... then the server return ERROR reading http body: Socket read returned insufficient data: Minal Jain -- Posted via http://www.ruby-forum.com/. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.