Hello, my scenario is that i''m using Flex to upload to a remote server. there are two servers involved..one that runs the web app and one that only stores the file. everytime i do this i get an io error...once, i hit the upload button again and it actually did the upload so i decided to write the code to do the upload twice (awful hack i know) which works only for smaller files. Larger files appear as though the upload is happening but still zero length...everything appears to be happening but the actual writing of the file...i think this is related to sessions but have no way to know for sure what''s happening...is there a way to increase the time a session is established? thanks much -- Posted via http://www.ruby-forum.com/.
I''m not sure if this is what you are looking for, but the session cookies don''t get sent by flex/flash when you upload a file. I had to make a request before the file upload to get a unique upload id, store it the database and return it to flex. Then when I acually send up the file I tag it in the params of the upload. I''m interested to know if anyone came up with a other workarounds for the problem? On Jul 25, 4:00 pm, Percy Klaasch <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Hello, > > my scenario is that i''m using Flex to upload to a remote server. there > are two servers involved..one that runs the web app and one that only > stores the file. everytime i do this i get an io error...once, i hit > the upload button again and it actually did the upload so i decided to > write the code to do the upload twice (awful hack i know) which works > only for smaller files. Larger files appear as though the upload is > happening but still zero length...everything appears to be happening but > the actual writing of the file...i think this is related to sessions but > have no way to know for sure what''s happening...is there a way to > increase the time a session is established? > > thanks much > -- > Posted viahttp://www.ruby-forum.com/.
On 26 Jul 2009, at 10:15, Josh wrote:> I''m not sure if this is what you are looking for, but the session > cookies don''t get sent by flex/flash when you upload a file. I had to > make a request before the file upload to get a unique upload id, store > it the database and return it to flex. Then when I acually send up the > file I tag it in the params of the upload. > > I''m interested to know if anyone came up with a other workarounds for > the problem?For more recent versions of Rails (afaik 2.3 or higher): http://thewebfellas.com/blog/2008/12/22/flash-uploaders-rails-cookie-based-sessions-and-csrf-rack-middleware-to-the-rescue If you''re using an older Rails version, you can check out a post I made quite a while ago: http://www.ruby-forum.com/topic/161291 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 -~----------~----~----~----~------~----~------~--~---
Hi Peter, I''ve seen both of these posts, and I''ve implemented the middleware solution...ironically...i have no problem uploading to the server hosting the web-app...but the problem appears when writing the file to the storage server which is auto-linked through nfs...it works fine for smaller files, but when i tried to write a 12MB file it fails..is there a separate session being established by the storage server or is there a session i can get from the server running the web-app in this situation (prolonged file transfer). thanks again percy Peter De Berdt wrote:> On 26 Jul 2009, at 10:15, Josh wrote: > >> I''m not sure if this is what you are looking for, but the session >> cookies don''t get sent by flex/flash when you upload a file. I had to >> make a request before the file upload to get a unique upload id, store >> it the database and return it to flex. Then when I acually send up the >> file I tag it in the params of the upload. >> >> I''m interested to know if anyone came up with a other workarounds for >> the problem? > > > For more recent versions of Rails (afaik 2.3 or higher): > http://thewebfellas.com/blog/2008/12/22/flash-uploaders-rails-cookie-based-sessions-and-csrf-rack-middleware-to-the-rescue > > If you''re using an older Rails version, you can check out a post I > made quite a while ago: > http://www.ruby-forum.com/topic/161291 > > > Best regards > > Peter De Berdt-- Posted via http://www.ruby-forum.com/.
Hi Josh, I''m interested in what you said here:>to get a unique upload id,where is this unique upload id and how did you get it? i''m new to ruby so although it makes sense i don''t know all the api. are you refering to the authenticity token?? i''ve turned mine off so is there another unique id i don''t know about? many thanks percy -- Posted via http://www.ruby-forum.com/.
Hey Percy, This sounds like a really strange problem. I am thinking a little out of the box here, but this sounds like a classic clustering issue. One server within the cluster has a different code set or is not working correct. Hence you get this case of "it sometimes works and other times it doesn''t". Double check that all your mongrel, or whatever you are running, have restarted properly and are running all the same code. I would highly doubt that this is problem with your flex code if you can upload the file properly, even if it is really small. Double check that file is not corrupt on the other end though. If you could replace your flex code with something else that can handle the same sort file transfer, that could isolate the problem. The only other thing I could think of is a bug within the front end server which is handling the file transfer. Good luck, Ziemek On Jul 26, 3:37 pm, Percy Klaasch <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Hi Josh, > I''m interested in what you said here: > > >to get a unique upload id, > > where is this unique upload id and how did you get it? i''m new to ruby > so although it makes sense i don''t know all the api. are you refering > to the authenticity token?? i''ve turned mine off so is there another > unique id i don''t know about? > > many thanks > > percy > > -- > Posted viahttp://www.ruby-forum.com/.