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.

DataObjectManager Module /

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Uploadify + DOM : respect uploadFolder & allowed extensions


Go to End


1265 Views

Avatar
brice

Community Member, 52 Posts

3 September 2010 at 4:23am

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;
}