By Ben Stuijts
I installed the strapi server on digital ocean and it works nice. But the standard configuration of the media library filesize is set to 1 MB, which is too less.
How can i configure this to - let’s say - 5MB per file (image)
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Accepted Answer
The answer is not in the strapi configuration, but in the nginx.conf file.
By default, Nginx has a limit of 1MB on file uploads. To set file upload size, you can use the client_max_body_size directive, which is part of Nginx’s ngx_http_core_module module. This directive can be set in the http, server or location context.
It sets the maximum allowed size of the client request body, specified in the “Content-Length” request header field. Here’s an example of increasing the limit to 100MB in /etc/nginx/nginx.conf file.
http { … client_max_body_size 100M; }
Hello, @bstuijts
You can double check the maxFileSize
in the config/environments/development/request.json
file
"parser": {
"enabled": true,
"multipart": true,
"formidable": {
"maxFileSize": 52428800
}
}
You can adjust the value according to your needs. You can further check the strapi documentation using the following link:
https://strapi.io/documentation/3.0.0-beta.x/plugins/upload.html
Hope this helps!
Regards, Alex
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.