Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

All other Modules /

Discuss all other Modules here.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Multiple Instances of SWFUpload in the Same Form


Go to End


5 Posts   3412 Views

Avatar
xeraa

Community Member, 58 Posts

24 March 2010 at 4:38am

I hope I haven't overlooked anything obvious, but is there a way to use multiple instances (new SWFUploadField(...) of SWFUpload in the same form? One field is for videos and one for images - just combining it into a single upload field is not desired.

Putting two instances into the same form made one "eat" the other: Only the first one was displayed but used the settings of the second one...

Avatar
UncleCheese

Forum Moderator, 4102 Posts

24 March 2010 at 4:53am

Yeah, it doesn't work that way. :(

There's so much javascript to manage in that class, I couldn't imagine having it support multiple instances at the time I built it. Now that I know a little better, I think it's a good item to have on the wishlist, though.

Avatar
xeraa

Community Member, 58 Posts

24 March 2010 at 5:00am

Thanks for the quick reply.
I've seen it for example at http://blogs.bigfish.tv/adam/examples/swfupload-jquery-plugin/examples/02%20-%20multiple%20uploaders.html (without taking a look at the underlying code) and was wondering if it was possible.

Well, at least it wasn't me ;-)

Avatar
UncleCheese

Forum Moderator, 4102 Posts

24 March 2010 at 5:14am

Oh, I'm sure it's possible. I have no doubts about that. But anytime you have multiple layers like this, they have to move in sync. The PHP and the javascript are managed by the same codebase, so there's a tradeoff for the simplicity you get out of SWFUploadField..

Avatar
joern

Community Member, 28 Posts

24 March 2010 at 11:12pm

Hi,
are you using the jQuery version? Does it work with one instance?