Jump to:

5554 Posts in 1742 Topics by 1227 members

Customising the CMS

SilverStripe Forums » Customising the CMS » replacement for setMaxFileSize?

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

Page: 1
Go to End
Author Topic: 1131 Views
  • theAlien
    Community Member
    131 Posts

    replacement for setMaxFileSize? Link to this post


    I would like to limit the global upload-limit for some filetypes.

    So I found the following method, that was used in older ss-versions (and is still mentioned in the api):

    File::setMaxFileSize(1024*1024*10, 1024*1024*10, 'jpg');

    But as far as I can see in 2.3.x and 2.4.0alpha it isn't in core anymore.

    Is there a global replacement for it?

  • MateuszU
    Community Member
    89 Posts

    Re: replacement for setMaxFileSize? Link to this post

    Hmm you can set AssetAdmin::$allowed_max_file_size for the cms, and then you can set setAllowedMaxFileSize on upload fields, but I can' find global setting. And I think there is none, see http://open.silverstripe.org/changeset/64402 , it says:

    API CHANGE Removed deprecated File->setMaxFileSize(), use Upload class


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.