Forum: Ruby on Rails Upload with iframe or ajax?

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.
Chamnap (Guest)
on 2007-07-18 08:32
(Received via mailing list)

I really wonder whether I should upload with ajax or with iframe. I
don't know which way it should be  the best of uploading file to the
server? Please, give me some ideas.....

JN_Coward (Guest)
on 2007-07-18 10:44
(Received via mailing list)
Unfortunately it is not possible to upload files with AJAX, since you
can't read the file from the input[type=file] fields with javascript.
If you go with the iframe method you should check out the
responds_to_parent plugin, makes things a heck of a lot easier.

There is another alternative though, that's pretty nice if you're
willing to endure some serious pain and frustration: you can upload
files with flash. Digitarald ( made a nice prepackaged
thingy for mootools, but it does need some tweaking for the Rails
backend (like the CGI/session_id fix). I don't know of any alternatives unfortunately.

Peter De Berdt (Guest)
on 2007-07-18 11:12
(Received via mailing list)
On 18 Jul 2007, at 08:28, JN_Coward wrote:

> alternatives unfortunately.
SWFUpload is also a Flash based solution, search the list archives, I
mentioned it a few times.

Best regards

Peter De Berdt
This topic is locked and can not be replied to.