Forum: Ruby on Rails Flash Filereference and Rails - getting http 422

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Fcf6328e679123eb81f8576eae5e8f74?d=identicon&s=25 wejrowski@gmail.com (Guest)
on 2009-05-07 02:19
(Received via mailing list)
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.
Fcf6328e679123eb81f8576eae5e8f74?d=identicon&s=25 wejrowski@gmail.com (Guest)
on 2009-05-08 18:00
(Received via mailing list)
Anyone know what the answer might be? Or an up to date link that
explains?
Fcf6328e679123eb81f8576eae5e8f74?d=identicon&s=25 wejrowski@gmail.com (Guest)
on 2009-05-08 20:53
(Received via mailing list)
Hmm. I think it may be something with the Authenticity Token. I think
I need to bypass it...
Fcf6328e679123eb81f8576eae5e8f74?d=identicon&s=25 wejrowski@gmail.com (Guest)
on 2009-05-09 01:06
(Received via mailing list)
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?
Fcf6328e679123eb81f8576eae5e8f74?d=identicon&s=25 wejrowski@gmail.com (Guest)
on 2009-05-09 03:03
(Received via mailing list)
oops, I meant still NOT working**

Any ideas?
6883e5ef03484d4fcef507d7b4f1d243?d=identicon&s=25 Matt Jones (Guest)
on 2009-05-09 18:03
(Received via mailing list)
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
Fcf6328e679123eb81f8576eae5e8f74?d=identicon&s=25 wejrowski@gmail.com (Guest)
on 2009-05-09 20:16
(Received via mailing list)
I didn't, but I'm running on a Mac, so I figured it wouldn't matter..
Plus that post is 3 years old!
This topic is locked and can not be replied to.