Jump to:

7940 Posts in 1543 Topics by 946 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » Uploadify + DOM : respect uploadFolder & allowed extensions

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: 849 Views
  • brice
    Avatar
    Community Member
    51 Posts

    Uploadify + DOM : respect uploadFolder & allowed extensions Link to this post

    Below is a patch to FileDataObjectManager in the latest SVN of DOM to allow Uploadify fields to respect uploadFolder & allowed extensions. UC: is there an issue tracker / other workflow that's preferred for patch submissions?

    Index: www/dataobject_manager/code/FileDataObjectManager.php
    ===================================================================
    --- www/dataobject_manager/code/FileDataObjectManager.php   (revision 14)
    +++ www/dataobject_manager/code/FileDataObjectManager.php   (working copy)
    @@ -293,6 +293,16 @@
             }
          }
          
    +      // [start] bb patch
    +      if(!empty($this->allowedFileTypes))
    +      {
    +
    +         $uploader->setFileTypes($this->getAllowedFileTypes(), $this->PluralTitle() . '(' . implode(',',$this->allowedFileTypes) . ')');
    +      }
    +
    +      $uploader->uploadFolder = $this->uploadFolder;
    +      // [end] bb patch
    +      
          return $fields;
       }
       

    849 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.