Skip to content

Commit 828c4f2

Browse files
feat(docs): modifying description
1 parent 60084d4 commit 828c4f2

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

docusaurus/docs/cms/features/media-library.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ module.exports = ({ env })=>({
147147
xsmall: 64
148148
},
149149
security: {
150-
allowedTypes: ['image/*', 'application/pdf'],
150+
allowedTypes: ['image/*', 'application/*'],
151151
deniedTypes: ['application/x-sh', 'application/x-dosexec']
152152
},
153153
},
@@ -177,7 +177,7 @@ export default () => ({
177177
xsmall: 64
178178
},
179179
security: {
180-
allowedTypes: ['image/*', 'application/pdf'],
180+
allowedTypes: ['image/*', 'application/*'],
181181
deniedTypes: ['application/x-sh', 'application/x-dosexec']
182182
},
183183
},
@@ -331,15 +331,15 @@ export default {
331331
#### Security
332332

333333
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; others are filtered out.
334+
Only files matching the defined security rules are uploaded.
335335

336336
The `security` configuration provides 2 options: `allowedTypes` or `deniedTypes`, which let you control which file types can or cannot be uploaded.
337337

338338
:::note
339-
It's best to define either `allowedTypes` or `deniedTypes`, not both, to avoid conflicts in file validation logic.
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`.
340340
:::
341341

342-
You can provide them by creating or editing [the `/config/plugins` file](/cms/configurations/plugins). The following example sets the `allowedTypes` filter:
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`:
343343

344344
<Tabs groupId="js-ts">
345345

@@ -351,7 +351,8 @@ module.exports = {
351351
upload: {
352352
config: {
353353
security: {
354-
allowedTypes: ['image/*', 'application/pdf']
354+
allowedTypes: ['image/*', 'application/*'],
355+
deniedTypes: ['application/x-sh', 'application/x-dosexec']
355356
},
356357
}
357358
}
@@ -368,7 +369,8 @@ export default {
368369
upload: {
369370
config: {
370371
security: {
371-
allowedTypes: ['image/*', 'application/pdf']
372+
allowedTypes: ['image/*', 'application/*'],
373+
deniedTypes: ['application/x-sh', 'application/x-dosexec']
372374
},
373375
}
374376
}

0 commit comments

Comments
 (0)