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.

Data Model Questions /

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

A short question: file extensions


Go to End


3 Posts   2387 Views

Avatar
WorkingSolution

Community Member, 18 Posts

22 June 2010 at 9:27pm

Edited: 22/06/2010 9:28pm

hello there, I have a short question:
How is it possible to add file-formats to upload in assets-folder? For example 'dot', 'dotx', 'xlst' and so on.

Avatar
Willr

Forum Moderator, 5523 Posts

22 June 2010 at 11:29pm

Suprised its not included by default. See File.php -> $allowed_extensions for the array of extensions. You could define your own array in your _config file..

File::$allowed_extensions[] = 'dot';
File::$allowed_extensions[] = 'dotx';

Or define the whole array (copy the existing ones from File.php to start with).

Avatar
WorkingSolution

Community Member, 18 Posts

23 June 2010 at 4:39am

Thx Will,

but this is what i've done in my first try.
I added to /mysite/_config.php

File::$allowed_extensions[] = 'dot';
File::$allowed_extensions[] = 'dotx'; 
File::$allowed_extensions[] = 'xlst'; 
File::$allowed_extensions[] = 'xlstx'; 

and called a "dev/build/?flush=1"

after this no more file-upload was possible; the frame in admin->files etc. shows a page-error after using the "upload files"-button.
Firefoxs developer-tools gave me no hint. Silverstripe is 2.4, no modules or widgets, only a custom template on in this time, system is debian lenny (and it's my 28th SilverStripe installation bthw ;) ).

At this moment I test it on a other (similar "lenny") system and it works well. Smells like I'm getting old or I have to make a new installation :(.
After rollback the _config.php everything works well (hm - yes without the file-extensions above...).