You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docusaurus/docs/cms/features/media-library.md
+62Lines changed: 62 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -111,6 +111,7 @@ When using the default upload provider, the following specific configuration opt
111
111
|`providerOptions.localServer`| Options that will be passed to <ExternalLinkto="https://github.com/koajs/static"text="koa-static"/> upon which the Upload server is build (see [local server configuration](#local-server)) | Object | - |
112
112
|`sizeLimit`| Maximum file size in bytes (see [max file size](#max-file-size)) | Integer |`209715200`<br/><br/>(200 MB in bytes, i.e., 200 x 1024 x 1024 bytes) |
113
113
|`breakpoints`| Allows to override the breakpoints sizes at which responsive images are generated when the "Responsive friendly upload" option is set to `true` (see [responsive images](#responsive-images)) | Object |`{ large: 1000, medium: 750, small: 500 }`|
114
+
|`security`| Configures validation rules for uploaded files to enhance media security | Object | - |
114
115
115
116
:::note
116
117
The Upload request timeout is defined in the server options, not in the Upload plugin options, as it's not specific to the Upload plugin but is applied to the whole Strapi server instance (see [upload request timeout](#upload-request-timeout)).
The Upload plugin validates files based on their actual MIME type rather than the declared file extension.
334
+
Only files matching the defined security rules are uploaded.
335
+
336
+
The `security` configuration provides 2 options: `allowedTypes` or `deniedTypes`, which let you control which file types can or cannot be uploaded.
337
+
338
+
:::note
339
+
You can use `allowedTypes` and `deniedTypes` separately or together to fine-tune which files are accepted. Files must match an allowed type and must not match any denied type. If you use a wildcard like `*` in `allowedTypes`, you can narrow down the validation by specifying exceptions in `deniedTypes`.
340
+
:::
341
+
342
+
You can provide them by creating or editing [the `/config/plugins` file](/cms/configurations/plugins). The following is an example of how to combine `allowedTypes` and `deniedTypes`:
0 commit comments