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're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

All other Modules /

Discuss all other Modules here.

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

SWFUpload with MultiForm


Go to End


5 Posts   1223 Views

Avatar
joern

Community Member, 28 Posts

24 March 2010 at 1:51am

Edited: 24/03/2010 1:53am

Hello,
I create new records from the frontend and in the first step i would like to upload the images.
I would like to create the record and his relationship only at the end of the process to avoid unnecessary data in the database.

The upload works, and I get the ID of the file.
But how do I save it in my multiFform-Session? Do I use a separate handleswfupload function?

Can i change the SWFUploadControls->$image_class?

I hope you can help me.
Thanks Jörn

Avatar
UncleCheese

Forum Moderator, 4102 Posts

24 March 2010 at 2:34am

Yeah, in your _config.php, just add:

SWFUploadControls::$image_class = "MyImage";

Avatar
joern

Community Member, 28 Posts

24 March 2010 at 3:10am

hi,
Thanks for your reply.
The class in the files-table is now correct, but how do I get in the form of multi-session?
I still have to use my own swfhandler-function and link it in there?

Avatar
UncleCheese

Forum Moderator, 4102 Posts

24 March 2010 at 3:46am

Shouldn't have to update the handleswfupload().. you have the ID, so there must be a way to store the value in your MultiForm module.. I've never used that module, but I assume it works on sessions. You could do it crudely by using Session::set(), I suppose.

Avatar
joern

Community Member, 28 Posts

24 March 2010 at 11:10pm

Yes, I'll have to save it in the session, but the ID is handed back again to the Flash.
I must save it before, right?

At the end of the form-step, I will save it from the session in the multi-form.