Jump to:

7939 Posts in 1472 Topics by 944 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » DataObjectManager custom upload destination

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Page: 1
Go to End
Author Topic: 808 Views
  • Tonyair
    Avatar
    Community Member
    81 Posts

    DataObjectManager custom upload destination Link to this post

    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'
          );

  • UncleCheese
    Avatar
    4085 Posts

    Re: DataObjectManager custom upload destination Link to this post

    Two ways:

    $manager->allowUploadFolderSelection();

    or

    $manager->setUploadFolder($folder);

    808 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.