I have a AJAX based form and when I use send_file there is no pop-up that appears to prompt user to download file... how do I fix this? Regards, Sudhindra -- 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 -~----------~----~----~----~------~----~------~--~---
rubyguy-DaQTI0RpDDMAvxtiuMwx3w@public.gmane.org
2009-Mar-26 07:50 UTC
Re: send_file using AJAX
On 26 Mar., 07:25, Sudhi Kulkarni <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> I have a AJAX based form and when I use send_file there is no pop-up > that appears to prompt user to download file... how do I fix this?http://www.catb.org/~esr/faqs/smart-questions.html#beprecise -- Best regards, David Knorr http://twitter.com/rubyguy --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Sudhi Kulkarni wrote:> I have a AJAX based form and when I use send_file there is no pop-up > that appears to prompt user to download file... how do I fix this?Did you Google for that first? It''s a FAQ in Ajax-land, because browsers have security constraints that prevent JavaScript from manipulating file input elements. The answer is do old-fashioned Ajax that bypasses JavaScript. When a form''s target field is the name of a 1-pixel <iframe> (and when it''s not a remote_form_* and hence calls no JS), submitting the form will send its data into that <iframe>, and into your server without refreshing your page. Google for that FAQ to learn how to update your page after the call, because I forget. -- Phlip http://www.zeroplayer.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 -~----------~----~----~----~------~----~------~--~---