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!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Sign up for Infrastructure as a Newsletter.
Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
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 theconfig/environments/development/request.json
fileYou 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