Answers.Body: <p>There's no way for the moment to limit filesize by Volume, but your can create a custom module with the <code>EVENT_BEFORE_SAVE</code> hooked on Assets.</p>
  
  <p>Here's a <a href="https://craftcms.stackexchange.com/questions/23261/how-to-set-different-file-size-upload-limits-for-different-asset-sources">related post</a>.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-14T15:03:16.190Z
Answers.Text: '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.
Answers.UserDisplayName: Jamie Wade
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-14T15:26:10.193Z
Answers.Text: Not enough coffee this morning -_-
Answers.UserDisplayName: Maxime Lafrenière
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-14T14:37:25.947Z
Answers.LastActivityDate: 2019-02-14T16:22:40.047Z
Answers.LastEditDate: 2019-02-14T16:22:40.047Z
Answers.UserDisplayName: Maxime Lafrenière
Body: <p>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.</p>
  
  <p>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. </p>
  
  <p>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.</p>
  
  <p>Does anyone have any good documentation for where to begin with this? It is version 3.0</p>
  
Tags: <assets><limit>
Title: Restricting file size for an Assets Volume
ThreadText: # Restricting file size for an Assets Volume
  
  (Asked by: username_0 on 2019-02-14)
  
  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
  
  **Tags:** assets, limit
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-02-14. Score: 2
  
  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](https://craftcms.stackexchange.com/questions/23261/how-to-set-different-file-size-upload-limits-for-different-asset-sources).
  
  > **Comments:**
  > **username_2**: '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.  
  > **username_1**: Not enough coffee this morning -_-  
  
  ---
  
  