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:

DataObjectManager Module /

Discuss the DataObjectManager module, and the related ImageGallery module.

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

DataObjectManager custom upload destination


Go to End


2 Posts   1170 Views

Avatar
Tonyair

Community Member, 81 Posts

14 July 2010 at 5:13am

How can I add custom upload destination folder?

And also I want parse FileName in order to set Item.Name, shall I use onBeforeWrite?

$dataobjectmanager = new ImageDataObjectManager(
				$this,
				'ItemsPage',
				'Item',
				'Photo',
				array('Thumb' => 'Photo', 'Name' => 'Name', 'Description' => 'Description'),
				'getCMSFields_forPopup'
		);

Avatar
UncleCheese

Forum Moderator, 4102 Posts

14 July 2010 at 5:50am

Two ways:

$manager->allowUploadFolderSelection();

or

$manager->setUploadFolder($folder);