I have a use case where I want to limit the allowed file size for a certain Assets Volume to 20kb. All other volumes should be allowed files no matter the size.

I have looked at some other threads already that suggest developing a plugin to do this, or use the Yii event system for file uploads.

I have made other simple plugins before that interacted with entries, but I cannot understand how to make a plugin that latches onto the file uploading event.

Does anyone have any good documentation for where to begin with this? It is version 3.0

1 Answer 1


There's no way for the moment to limit filesize by Volume, but your can create a custom module with the EVENT_BEFORE_SAVE hooked on Assets.

Here's a related post.

  • 'Limit' for Craft fields refers to the maximum number of files that can be assigned to a field, not the file size (or total file size) of those files.
    – Jamie Wade
    Feb 14, 2019 at 15:03
  • Not enough coffee this morning -_- Feb 14, 2019 at 15:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.