silverstripe/silverstripe-framework — pull request #3273 by Turnerj (2014-07-08 06:27:43+00:00)
Title: FEATURE: Added max file size by type for uploads

Adds the ability to specify the max file size for a type via YAML config.

```yaml
Upload_Validator:
defaultMaxFileSize:
'[image]': '1m'
'[doc]': '5m'
'jpeg': 2000
```

These settings can still be updated on the instance variable via the method `setAllowedMaxFileSize`.

You can specify an App Category to limit the max file for rather than each individual file extension. This uses the built-in `app_categories` list. To specify an App Category in the config, just use the square brackets `[` and `]` around the name. This is to differentiate between an extension being limited and an entire category being limited.

With this update, it also adds support for `File::ini2bytes` when setting the allowed max file size.