@strapi/provider-upload-local 4.0.0 → 4.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +40 -19
- package/package.json +4 -7
package/README.md
CHANGED
|
@@ -1,30 +1,51 @@
|
|
|
1
|
-
# strapi
|
|
1
|
+
# @strapi/provider-upload-local
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## Resources
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
- [LICENSE](LICENSE)
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## Links
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
- [Strapi website](https://strapi.io/)
|
|
10
|
+
- [Strapi documentation](https://docs.strapi.io)
|
|
11
|
+
- [Strapi community on Discord](https://discord.strapi.io)
|
|
12
|
+
- [Strapi news on Twitter](https://twitter.com/strapijs)
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
10
15
|
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
16
|
+
```bash
|
|
17
|
+
# using yarn
|
|
18
|
+
yarn add @strapi/provider-upload-local
|
|
19
|
+
|
|
20
|
+
# using npm
|
|
21
|
+
npm install @strapi/provider-upload-local --save
|
|
18
22
|
```
|
|
19
23
|
|
|
20
|
-
|
|
24
|
+
## Configurations
|
|
21
25
|
|
|
22
|
-
|
|
26
|
+
This provider has only one parameter: `sizeLimit`.
|
|
23
27
|
|
|
24
|
-
|
|
28
|
+
### Provider Configuration
|
|
29
|
+
|
|
30
|
+
`./config/plugins.js`
|
|
31
|
+
|
|
32
|
+
```js
|
|
33
|
+
module.exports = ({ env }) => ({
|
|
34
|
+
// ...
|
|
35
|
+
upload: {
|
|
36
|
+
config: {
|
|
37
|
+
provider: 'local',
|
|
38
|
+
providerOptions: {
|
|
39
|
+
sizeLimit: 100000,
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
// ...
|
|
44
|
+
});
|
|
45
|
+
```
|
|
25
46
|
|
|
26
|
-
|
|
47
|
+
The `sizeLimit` parameter must be a number. Be aware that the unit is in bytes, and the default is 1000000. When setting this value high, you should make sure to also configure the body parser middleware `maxFileSize` so the file can be sent and processed. Read more [here](https://docs.strapi.io/developer-docs/latest/plugins/upload.html#configuration)
|
|
27
48
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
49
|
+
### Security Middleware Configuration
|
|
50
|
+
|
|
51
|
+
Special configuration of the Strapi Security Middleware is not required on this provider since the default configuration allows loading images and media from `"'self'"`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@strapi/provider-upload-local",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.4",
|
|
4
4
|
"description": "Local provider for strapi upload",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"upload",
|
|
@@ -35,14 +35,11 @@
|
|
|
35
35
|
"test": "echo \"no tests yet\""
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@strapi/utils": "4.0.
|
|
38
|
+
"@strapi/utils": "4.0.4"
|
|
39
39
|
},
|
|
40
40
|
"engines": {
|
|
41
|
-
"node": ">=12.
|
|
41
|
+
"node": ">=12.22.0 <=16.x.x",
|
|
42
42
|
"npm": ">=6.0.0"
|
|
43
43
|
},
|
|
44
|
-
"
|
|
45
|
-
"isProvider": true
|
|
46
|
-
},
|
|
47
|
-
"gitHead": "b181702f0202b2c6d645d42b195a831f25cd0b03"
|
|
44
|
+
"gitHead": "d81919ac2272948b3f5d3b25a4cf8cc7b6994460"
|
|
48
45
|
}
|