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.

Customising the CMS /

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

replacement for setMaxFileSize?


Go to End


2 Posts   1640 Views

Avatar
theAlien

Community Member, 131 Posts

28 January 2010 at 1:46pm

Hi,

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?

Avatar
MateuszU

Community Member, 89 Posts

1 February 2010 at 10:09am

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

cheers
mat