strapi-provider-upload-local-with-blur-base64
v2.0.1
Published
A copy of the official strapi local provider to store a blurred version of images as base64 in provider_metadata.base64
Downloads
8
Readme
strapi-provider-upload-local-with-blur-base64
Description
A copy of the official strapi local provider with the difference that it stores a blur image as base64 in the field provider_metadata.base64
.
This is done so that it integrates nicely with Next.js Image's blur attribute.
Resources
Links
Installation
# using yarn
yarn add strapi-provider-upload-local-with-blur-base64
# using npm
npm install strapi-provider-upload-local-with-blur-base64 --save
Configurations
This provider has only one parameter: sizeLimit
.
Provider Configuration
./config/plugins.js
module.exports = ({ env }) => ({
// ...
upload: {
config: {
provider: 'strapi-provider-upload-local-with-blur-base64',
providerOptions: {
sizeLimit: 100000,
},
},
},
// ...
});
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
Security Middleware Configuration
Special configuration of the Strapi Security Middleware is not required on this provider since the default configuration allows loading images and media from "'self'"
.