Jump to:

23370 Posts in 18160 Topics by 2864 members

General Questions

SilverStripe Forums » General Questions » Add file upload types

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Page: 1
Go to End
Author Topic: 1411 Views
  • gman
    Avatar
    Community Member
    11 Posts

    Add file upload types Link to this post

    I noticed that by default .odt is not an allowed file upload. Where do you change the file types allowed for upload?

  • swaiba
    Avatar
    Forum Moderator
    1784 Posts

    Re: Add file upload types Link to this post

    I think something like the following might help... this means you have to intercept the field in getCMSfields and also not that these are case sensitive.... please look at sapphire\forms\FileField.php for more info....

    $uploadField->setAllowedExtensions('odt');

  • Invader_Zim
    Avatar
    Community Member
    141 Posts

    Re: Add file upload types Link to this post

    An alternative solution would be to add this line

    File::$allowed_extensions[] = 'odt';


    to your mysite/_config.php.

    Cheers,
    Christian

  • Brendo
    Avatar
    Community Member
    7 Posts

    Re: Add file upload types Link to this post

    Gman,

    did you solve your issue?

    do you have any problems linking or accessing the file once uploaded?

    regards

    Brendon

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