Hello, I really wonder whether I should upload with ajax or with iframe. I don''t know which way it should be the best of uploading file to the server? Please, give me some ideas..... Thanks Chamnap --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Unfortunately it is not possible to upload files with AJAX, since you can''t read the file from the input[type=file] fields with javascript. If you go with the iframe method you should check out the responds_to_parent plugin, makes things a heck of a lot easier. There is another alternative though, that''s pretty nice if you''re willing to endure some serious pain and frustration: you can upload files with flash. Digitarald (digitarald.de) made a nice prepackaged thingy for mootools, but it does need some tweaking for the Rails backend (like the CGI/session_id fix). I don''t know of any script.aculo.us alternatives unfortunately. /Jonas On 18 Juli, 13:31, Chamnap <chamnapchh...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hello, > > I really wonder whether I should upload with ajax or with iframe. I > don''t know which way it should be the best of uploading file to the > server? Please, give me some ideas..... > > Thanks > Chamnap--~--~---------~--~----~------------~-------~--~----~ 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 18 Jul 2007, at 08:28, JN_Coward wrote:> Unfortunately it is not possible to upload files with AJAX, since you > can''t read the file from the input[type=file] fields with javascript. > If you go with the iframe method you should check out the > responds_to_parent plugin, makes things a heck of a lot easier. > > There is another alternative though, that''s pretty nice if you''re > willing to endure some serious pain and frustration: you can upload > files with flash. Digitarald (digitarald.de) made a nice prepackaged > thingy for mootools, but it does need some tweaking for the Rails > backend (like the CGI/session_id fix). I don''t know of any > script.aculo.us alternatives unfortunately.SWFUpload is also a Flash based solution, search the list archives, I mentioned it a few times. http://search.gmane.org/? query=SWFUpload&author=peter&group=gmane.comp.lang.ruby.rails&sort=relev ance&DEFAULTOP=and&xP=swfupload&xFILTERS=Gcomp.lang.ruby.rails-Apeter +de+berdt---A 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 -~----------~----~----~----~------~----~------~--~---