Changing allowed file extensions globally

7 posts by 5 authors in: Forums > CMS Builder
Last Post: January 28, 2015   (RSS)

I would like to add pdf to the allowed upload extensions in PageContent wsywig.  I know how to do this on each page but wondered if there is a file I can modify that would make this auto for all pages?

By Damon - January 26, 2015

Hi,

There isn't a way to automatically add an upload extension to every wysiwyg in every section editor.

This has to be done one at at time or you could download your /data/schema/ files for the section editors you wanted to add the extension to, open them in a code editor and change this:

'allowedExtensions' => 'gif,jpg,png,wmv,mov,swf',

to this:

'allowedExtensions' => 'gif,jpg,png,wmv,mov,swf, pdf',

Then save and upload back to your server.

Hope this helps!

Cheers,
Damon Edis - interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

By Toledoh - January 26, 2015

Hey Damon,

I think it would be good to have this change done globally for the next CMSB update.  Really, I think wmv, mov, swf are not required, but PDF is a very common requirement.  Or maybe adding a section to settings that allows this to be controlled globally?

Cheers,

Tim (toledoh.com.au)

I agree, great idea.  In the meantime I was able to grab the files in /data/schema/ and do a find and replace to add pdf to all.  Then upload them via ftp and you are good to go.  Saved me from having to go into each section editor.

By Dave - January 27, 2015

Hi All, 

Currently the default value is stored in /lib/menus/database/editField_functions.php

and it looks like this:

$defaultValue['allowedExtensions']     = 'gif,jpg,png,wmv,mov,swf,pdf';

So if you change that it will change the list of allowed extensions that appear by default when you add a new field.

Hope that helps!

Dave Edis - Senior Developer
interactivetools.com

Even better than my method!  Thanks.  :)