# Swfupload with active\_record\_store? Or any other 'mass'-uploader?

**URL:** <https://www.ruby-forum.com/t/swfupload-with-active-record-store-or-any-other-mass-uploader/148887>\
**Category:** Rails\
**Created:** [September 18, 2008, 12:47am UTC](https://www.ruby-forum.com/t/swfupload-with-active-record-store-or-any-other-mass-uploader/148887 "2008-09-18T00:47:18Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![joergbattermann](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/edb3f5/32.png) [@joergbattermann](https://www.ruby-forum.com/u/joergbattermann)\
**Post date:** [September 18, 2008, 12:47am UTC](https://www.ruby-forum.com/t/swfupload-with-active-record-store-or-any-other-mass-uploader/148887/1 "2008-09-18T00:47:18Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![joergbattermann](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/edb3f5/32.png) [@joergbattermann](https://www.ruby-forum.com/u/joergbattermann)\
**Post date:** [September 18, 2008, 9:59am UTC](https://www.ruby-forum.com/t/swfupload-with-active-record-store-or-any-other-mass-uploader/148887/2 "2008-09-18T09:59:24Z")

</div>

On 18 Sep 2008, at 00:46, JÃ¶rg Battermann wrote:

> 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?

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):  
[http://www.ruby-forum.com/topic/161291](http://www.ruby-forum.com/topic/161291)

Best regards

Peter De Berdt

---

<div class="post-metadata">

**Author:** ![joergbattermann](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/edb3f5/32.png) [@joergbattermann](https://www.ruby-forum.com/u/joergbattermann)\
**Post date:** [September 20, 2008, 3:56pm UTC](https://www.ruby-forum.com/t/swfupload-with-active-record-store-or-any-other-mass-uploader/148887/3 "2008-09-20T15:56:20Z")

</div>

Hello there Peter,

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

> <https://gist.github.com/11753>

Cheers and have a nice weekend! 🙂

-J

---

<div class="post-metadata">

**Author:** ![joergbattermann](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/edb3f5/32.png) [@joergbattermann](https://www.ruby-forum.com/u/joergbattermann)\
**Post date:** [October 8, 2008, 9:41pm UTC](https://www.ruby-forum.com/t/swfupload-with-active-record-store-or-any-other-mass-uploader/148887/4 "2008-10-08T21:41:05Z")

</div>

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 [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> On 18 Sep 2008, at 00:46, Jörg Battermann wrote:
> 
> > Has anyone successfully integrated swfupload into his/her rails (2.x)  
> > [… snip …]

---

<div class="post-metadata">

**Author:** ![joergbattermann](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/edb3f5/32.png) [@joergbattermann](https://www.ruby-forum.com/u/joergbattermann)\
**Post date:** [November 17, 2008, 1:14am UTC](https://www.ruby-forum.com/t/swfupload-with-active-record-store-or-any-other-mass-uploader/148887/5 "2008-11-17T01:14:13Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![joergbattermann](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/edb3f5/32.png) [@joergbattermann](https://www.ruby-forum.com/u/joergbattermann)\
**Post date:** [October 9, 2008, 12:21pm UTC](https://www.ruby-forum.com/t/swfupload-with-active-record-store-or-any-other-mass-uploader/148887/6 "2008-10-09T12:21:19Z")

</div>

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)).

Best regards

Peter De Berdt
