Jump to:

3460 Posts in 1064 Topics by 739 members

Data Model Questions

SilverStripe Forums » Data Model Questions » A short question: file extensions

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

Page: 1
Go to End
Author Topic: 1408 Views
  • WorkingSolution
    Avatar
    Community Member
    18 Posts

    A short question: file extensions Link to this post

    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.

  • Willr
    Avatar
    Forum Moderator
    5508 Posts

    Re: A short question: file extensions Link to this post

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

  • WorkingSolution
    Avatar
    Community Member
    18 Posts

    Re: A short question: file extensions Link to this post

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

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