Forum: Ruby on Rails Flash Upload and Ruby

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
heavysixer (Guest)
on 2005-11-15 18:33
(Received via mailing list)
Please forgive me if you get this twice, I sent it yesterday but never
it appear on the list.

Hi Rubiests,
This is my first posting to the rails group so please forgive me if this
a well-covered question (though I did check the wiki and the faqs on the

I am trying to create a Flash-based bulk uploader for my first Ruby
You can see an example of the uploader running in a PHP script here:

This works swimmingly in php but there is no joy in Ruby.

I am using version "0.14.3" of Rails and "1.8.2" of Ruby on a Mac OS X

The webbrick spits out a very unceremonious error when I try to call my
"admin/flash_create" action:

[14/Nov/2005:23:10:01 PST] "POST /admin/flash_create HTTP/1.1" 500 8175
- -> /admin/flash_create

When doing some research on the problem I found a bug report on the

They suggested installing the flash-fix plugin. I have installed the
flash-fix plugin into my vender/plugin directory but was unsure what to
past that.

My very basic method in the admin_controller is:

def flash_create
@params['Filedata']['content _name'] =
@params['Filedata']['content_type'] =
@params['Filedata']['data'] = @params['Filedata']['tmp_name'].read
@photo =['Filedata'])

"Filedata" is the field that Macromedia specifies for their multipart

Any help is greatly appreciated!

ettober (Guest)
on 2005-11-15 18:51
(Received via mailing list)
take a look at this:

Hoipe it helps,


Il giorno 15/nov/05, alle ore 17:32, M Daggett ha scritto:
heavysixer (Guest)
on 2005-11-15 19:39
(Received via mailing list)
I think he is the one that wrote the plugin. I did incorporate it into
rails app but no joy.
heavysixer (Guest)
on 2005-11-16 05:27
(Received via mailing list)
I was able to get the Flash Ruby synergy all dialed in (sorta).
I updated my blog with the code and details:

I am able to get uploads that store the files on the physical drive as
opposed to as a blob in the database.
At first I was a bit confused why this was but then it dawned on me
that I was creating the object in the first method.

def new
   @picture =
   ... show the upload page

then when flash was called to submit to the page I got an error
because my picture object was nil. I can only assume this is because
the ruby and flash upload happens outside of the scope of ruby's
session object.

When the file was submitted ruby would have no context in which to
view the request. This brings up an interesting question. I originally
inteded on doing some sort of lock/key system whereby my first method
would define a variable and then pass it along to flash so that it
could be embeded into the post (and authenticated by ruby). This would
keep simultanious users from clobbering each other and prevent people
from subverting my upload process.

Here is another problem related to the first. Presently my app
authenticates the user before the URL filter. If the user is not
authenticated then it redirects them to the login. Knowing that I
cannot append anything side the actual post object I guess I am left
with only one option which is to append it to the url string.

Is this wise, does anyone have a better idea?


On 11/15/05, M Daggett <removed_email_address@domain.invalid> wrote:
> >
> >
> > This is my first posting to the rails group so please forgive me if this
> >
> site:
> > def flash_create
> >
> > Mark
> > removed_email_address@domain.invalid
> --
> --------------------------------------------------------------------
> I am Mark Daggett and I approve this message.

This topic is locked and can not be replied to.