swfupload with active_record_store? Or any other 'mass'-uploader?

41 views
Skip to first unread message

Jörg Battermann

unread,
Sep 17, 2008, 6:46:35 PM9/17/08
to Ruby on Rails: Talk
Hello there,

Has anyone successfully integrated swfupload into his/her rails (2.x)
project using a non cookie based session store? I am asking because
with the active_record_store (let alone stefan kaes'
sql_session_store) I can't get it to work at all, when re-enabling
cookies (meh) it works .. uploading wise, but now I get
InvalidAuthenticityToken Exceptions in other places, e.g. when
destroying an object.

Alternatively, does anyone know (first hand) any other, rails-
friendlier mass-uploading solutions?


Cheers,
-J

Peter De Berdt

unread,
Sep 18, 2008, 3:58:45 AM9/18/08
to rubyonra...@googlegroups.com
You're going to face the same problem with all of them, and to be honest, SWFUpload is the only one I got to work with Rails >2 apps.

If you follow my instructions as I posted them a while ago, you should be able to get it to work (my solution works for sure with the cookiestore, but it should work for any session store):


Best regards


Peter De Berdt


Jörg Battermann

unread,
Sep 20, 2008, 9:55:25 AM9/20/08
to Ruby on Rails: Talk
Hello there Peter,

thanks! I've taken your modified swfupload fix and simply added a tiny
block to accommodate the ActiveRecord:Store

http://gist.github.com/11753


Cheers and have a nice weekend! :)

-J

JWB

unread,
Oct 8, 2008, 1:59:22 PM10/8/08
to Ruby on Rails: Talk
We applied the patch as Peter described and had good results.
Recently, the uploads started failing for a significant number of our
users - they are told to login even though they already
authenticated. We upgraded to Rails 2.1.1, so I'm looking for a cause
there (though tests succeed). I'm also looking for browser-specific
behavior, since some users seem to be able to upload successfully.

Please let me know if you've seen any new issues crop up with Rails
2.1.1.

On Sep 18, 12:58 am, Peter De Berdt <peter.de.be...@pandora.be> wrote:
> On 18 Sep 2008, at 00:46, Jörg Battermann wrote:
>
> > Has anyone successfully integrated swfupload into his/her rails (2.x)
[ .. snip ..]

Peter De Berdt

unread,
Oct 9, 2008, 6:20:29 AM10/9/08
to rubyonra...@googlegroups.com

On 08 Oct 2008, at 19:59, JWB wrote:

We applied the patch as Peter described and had good results.
Recently, the uploads started failing for a significant number of our
users - they are told to login even though they already
authenticated.  We upgraded to Rails 2.1.1, so I'm looking for a cause
there (though tests succeed).  I'm also looking for browser-specific
behavior, since some users seem to be able to upload successfully.

Please let me know if you've seen any new issues crop up with Rails
2.1.1.

One thing to be aware of, is that the Flash Player 10 beta will break all of the current Flash-based uploaders because of new security measures put into place. A workaround solution has been posted on the Adobe Flash blog (putting a transparent flash movie over the link instead of calling some javascript that triggers the file dialog from the onclick event) but I don't think any of the uploaders has implemented such a solution yet.

I haven't come across your problem though, even though our users have a variety of browsers (we don't support IE6 anymore, and have no official support for Opera and Chrome (yet)).

Jörg Battermann

unread,
Nov 16, 2008, 7:13:30 PM11/16/08
to Ruby on Rails: Talk
The current swfupload 2.2 betas have that workaround integrated.. and
it works perfectly fine. Only minor changes need to be made the way
the swfupload is initialized...

-J
Reply all
Reply to author
Forward
0 new messages