Hi All, Does anyone managed to run SWFUpload with rails 2.0.2 ? Any help greatly appreciated ! Regards, Lukas -- 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 -~----------~----~----~----~------~----~------~--~---
Create a session_patch.rb file in the initializers directory, with the following content. Use the cookie_only session setting toallow the desired actions to receive the session id outside the cookie: ex: session :cookie_only => false, :only => %w(file_upload) -- cut here -- class CGI::Session alias original_initialize initialize # The following code is a work-around for the Flash 8 bug that prevents our multiple file uploader # from sending the _session_id. Here, we hack the Session#initialize method and force the session_id # to load from the query string via the request uri. (Tested on Lighttpd, Mongrel, Apache) def initialize(cgiwrapper, option = {}) #RAILS_DEFAULT_LOGGER.debug "#{__FILE__}:#{__LINE__} Session options #{ option.inspect} *********************" unless option[''cookie_only''] #RAILS_DEFAULT_LOGGER.debug "#{__FILE__}:#{__LINE__} Initializing session object #{cgiwrapper.env_table[''RAW_POST_DATA'']} *********************" session_key = option[''session_key''] || ''_session_id'' query_string = if (rpd = cgiwrapper.env_table[''RAW_POST_DATA'']) and rpd != '''' rpd elsif (qs = cgiwrapper.env_table[''QUERY_STRING'']) and qs != '''' qs elsif (ru = cgiwrapper.env_table[''REQUEST_URI''][0..-1]).include?(''?'') ru[(ru.index(''?'') + 1)..-1] end if query_string and query_string.include?(session_key) option[''session_id''] query_string.scan(/#{session_key}=(.*?)(&.*?)*$/).flatten.first end end original_initialize(cgiwrapper,option) end end On Jan 23, 2008 4:13 PM, luk asz <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Hi All, > > Does anyone managed to run SWFUpload with rails 2.0.2 ? > > Any help greatly appreciated ! > > Regards, > Lukas > -- > Posted via http://www.ruby-forum.com/. > > > >-- Eider Oliveira Site: http://eider.eti.br Blog: http://eider.eti.br/Home/Blog/Blog.html "If I had more time, I''d have written you a shorter letter." Pascal --~--~---------~--~----~------------~-------~--~----~ 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 24 Jan 2008, at 10:57, Eider Oliveira wrote:> Create a session_patch.rb file in the initializers directory, with > the following content. Use the cookie_only session setting to > allow the desired actions to receive the session id outside the > cookie: > > ex: session :cookie_only => false, :only => %w(file_upload)This probably only works if you''re using a database session table and not the new cookie based session i presume? 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 -~----------~----~----~----~------~----~------~--~---
Thank you for the hint. I will try that and post later if that worked out for me. Regards, Lukasz -- 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 expect it to work on all session stores (including memcache), excepting the new cookie store. If you can''t send the session Id in a cookie, you won''t be able to send the session cookie. On Jan 24, 2008 9:02 AM, Peter De Berdt <peter.de.berdt-LPO8gxj9N8aZIoH1IeqzKA@public.gmane.org> wrote:> > On 24 Jan 2008, at 10:57, Eider Oliveira wrote: > > Create a session_patch.rb file in the initializers directory, with the > following content. Use the cookie_only session setting toallow the desired > actions to receive the session id outside the cookie: > > ex: session :cookie_only => false, :only => %w(file_upload) > > > This probably only works if you''re using a database session table and not > the new cookie based session i presume? > > > Best regards > > > Peter De Berdt > > > > >-- Eider Oliveira Site: http://eider.eti.br Blog: http://eider.eti.br/Home/Blog/Blog.html "If I had more time, I''d have written you a shorter letter." Pascal --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hello Eider, Unfortunately this fix does not work for me. I am using restful_authentication and I receive this error in logfile: ActionController::InvalidAuthenticityToken I tried to URL.encode the session id but it does not work. I have been playing with this issue for so much time that I am totally lost. Maybe there is any other hint from your side more... Regards, Lukasz -- 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 using it, but it''s not tied to rails. What''s your problem? Picking it up in the controller? On Jan 23, 10:13 am, luk asz <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Hi All, > > Does anyone managed to run SWFUpload with rails 2.0.2 ? > > Any help greatly appreciated ! > > Regards, > Lukas > -- > 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 -~----------~----~----~----~------~----~------~--~---
eggie5 wrote:> I''m using it, but it''s not tied to rails. What''s your problem? Picking > it up in the controller?This is nuts ! It works under IE7 but does not work under Firefox 2 ! ? It''s sick :-) Regards, Lukasz -- 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 -~----------~----~----~----~------~----~------~--~---
works for me. What OS? On Jan 28, 12:31 pm, luk asz <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> eggie5 wrote: > > I''m using it, but it''s not tied to rails. What''s your problem? Picking > > it up in the controller? > > This is nuts ! > > It works under IE7 but does not work under Firefox 2 ! ? > > It''s sick :-) > > Regards, > Lukasz > -- > 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 -~----------~----~----~----~------~----~------~--~---
eggie5 wrote:> works for me. > > What OS?I use Ubuntu. But here next to my computer stands windows machine. Simply: Windows FF - does not work Windows IE7 - works Linux Firefox - does not work I have almost given up. Any ideas ? Maybe it''s a problem with that fix provided at the beginning of the topic ? Lukasz -- 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 -~----------~----~----~----~------~----~------~--~---
eggie5 wrote:> works for me. > > What OS?ok so could you post all of your rails app settings and code snips please... i am really getting out of ideas... :) thanks lukasz -- 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 -~----------~----~----~----~------~----~------~--~---
What isn''t working with it? On Jan 28, 1:02 pm, luk asz <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> eggie5 wrote: > > works for me. > > > What OS? > > I use Ubuntu. But here next to my computer stands windows machine. > > Simply: > Windows FF - does not work > Windows IE7 - works > Linux Firefox - does not work > > I have almost given up. > > Any ideas ? Maybe it''s a problem with that fix provided at the beginning > of the topic ? > > Lukasz > > -- > 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 -~----------~----~----~----~------~----~------~--~---
eggie5 wrote:> What isn''t working with it?Indeed it is working but just in Internet Explorer 7. I found an information that flash player for Firefox is problematic. Do you have any fix for that ? Regards, Luaksz -- 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 implemented something with swfupload and simply announce the files with an ajax call before uploading them, storing some record in the db, handing back some id/code which then is posted together with the file upload. that way i get normal session handling and nobody can upload anything without that ''handshake''. i think that''s secure enough. -- 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 -~----------~----~----~----~------~----~------~--~---