wejrowski-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2009-May-07 00:18 UTC
Flash Filereference and Rails - getting http 422
I''ve spent the last few days trying to figure this out. I have my own Filereference class I use with PHP. But I''m trying to use it with Rails and can''t seem to get it to work. I even downloaded some samples online and can''t get those to work (http://blog.vixiom.com/2006/09/08/ multiple-file-upload-with-flash-and-ruby-on-rails/). Basically my rails is something like this: data = params[:filedata] name = params[:Filename] directory = "public/data" path = File.join(directory, name) File.open(path, ''wb'') do |file| file.puts data.read end And when I use filereference and upload it in flash I get an httpError: 422 I get this both in mine and the example''s file.
wejrowski-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2009-May-08 15:59 UTC
Re: Flash Filereference and Rails - getting http 422
Anyone know what the answer might be? Or an up to date link that explains?
wejrowski-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2009-May-08 18:51 UTC
Re: Flash Filereference and Rails - getting http 422
Hmm. I think it may be something with the Authenticity Token. I think I need to bypass it...
wejrowski-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2009-May-08 23:05 UTC
Re: Flash Filereference and Rails - getting http 422
K I figured out how to fetch and send the AuthToken.. It''s still now working. Anyone have any idea, or a resource for Flash file uploading to Rails 2.x?
wejrowski-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2009-May-09 01:02 UTC
Re: Flash Filereference and Rails - getting http 422
oops, I meant still NOT working** Any ideas?
Have you tried the "Flash 8 for Windows" fix on the blog page you linked? Without any more details about your environment, that''s the first thing I''d suspect. Not sure how that fix will interact with the new Rack stuff in 2.3, though. --Matt Jones On May 6, 7:18 pm, "wejrow...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" <wejrow...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I''ve spent the last few days trying to figure this out. I have my own > Filereference class I use with PHP. But I''m trying to use it with > Rails and can''t seem to get it to work. I even downloaded some samples > online and can''t get those to work (http://blog.vixiom.com/2006/09/08/ > multiple-file-upload-with-flash-and-ruby-on-rails/). > > Basically my rails is something like this: > > data = params[:filedata] > name = params[:Filename] > > directory = "public/data" > > path = File.join(directory, name) > File.open(path, ''wb'') do |file| > file.puts data.read > end > > And when I use filereference and upload it in flash I get an > httpError: 422 > I get this both in mine and the example''s file.