Forum: Ruby on Rails "AJAX" file uploading

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.
Jeff S. (Guest)
on 2006-01-28 00:56
I'm pretty new to actually contributing to a software project outside of
my own. I recently found the need to create an "ajax" uploader and
thought I'd share it with the community.

I write "ajax" because it acts like it's ajax but we all know that
javascript does not have filesystem access (for good reason) and thus
ajax uploading isn't possible in the standard sense. This uses a
technique borrowed from a Drupal module where by the form is targeted to
a hidden iframe. The response gets wrapped just before being sent. The
wrapper is essentially a javascript call that collects the response and
sends it to a callback in the parent window where it can be processed in
the normal prototype ways (insertion and such).

Please take a look. I didn't write any documentation for it (yet), but
it's fairly self explanitory for those that have been using Rails for
awhile. It's also very basic.

BTW, if anyone would like to assist me on how to write better software
I'd be most appreciative.
This topic is locked and can not be replied to.