As my app is continuing to grow a little older, I''ve come to the point where I want to allow a user to upload an avatar (with Paperclip) using AJAX. However, I''ve noticed just about the only way to get this done is to use the (imo) pretty dirty solutions with either Flash or the remote_form_for RJS stuff. For instance http://valums.com/wp-content/uploads/ajax-upload/demo-jquery.htm seems to offer a pretty neat solution on how to style the upload stuff, but from what I''ve read, it''s not possible to get this done properly due to the CSRF stuff. So now I''m wondering; isn''t it possible to get AJAX uploads working using jQuery with the CSRF protection enabled, without using Flash or RJS? Thanks so much in advance! -- 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.
Peter De Berdt
2010-Mar-20 22:22 UTC
Re: Rails AJAX file upload without Flash and RJS, just a dream?
On 20 Mar 2010, at 16:50, Lb2007 wrote:> As my app is continuing to grow a little older, I''ve come to the point > where I want to allow a user to upload an avatar (with Paperclip) > using AJAX. However, I''ve noticed just about the only way to get this > done is to use the (imo) pretty dirty solutions with either Flash or > the remote_form_for RJS stuff. > > For instance http://valums.com/wp-content/uploads/ajax-upload/demo-jquery.htm > seems to offer a pretty neat solution on how to style the upload > stuff, but from what I''ve read, it''s not possible to get this done > properly due to the CSRF stuff. > > So now I''m wondering; isn''t it possible to get AJAX uploads working > using jQuery with the CSRF protection enabled, without using Flash or > RJS?Until all browsers implement the HTML5 File API, one of those methods will have to do. Until then, this is just a dream: https://developer.mozilla.org/en/Using_files_from_web_applications 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-/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.