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

SWFUpload with MultiForm


Go to End


5 Posts   1331 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.