Cannot upload files bigger than 200MB

System Information
  • Strapi Version: v4.19.1
  • Operating System: MacOS / Docker
  • Database: Postgres v16
  • Node Version: v16.20.2
  • NPM Version: 8.19.4
  • Yarn Version: –

When uploading data files bigger than 200MB, Strapi returns a HTTP 413 and the message:

The uploaded file exceeds the maximum allowed asset size.

I followed the configuration in the documentation and I see the server picking up these configuration files when I change them. However, the behaviour remains. Content of my config/middlewares.ts:

export default [
  {
    name: "strapi::body",
    config: {
      formLimit: "256mb", // modify form body
      jsonLimit: "256mb", // modify JSON body
      textLimit: "256mb", // modify text body
      formidable: {
        maxFileSize: 1 * 1024 * 1024 * 1024, // multipart data, modify here limit of uploaded file size to 1GB
      },
    },
  },
];

and uploads.ts:

export default {
  upload: {
    config: {
      sizeLimit: 1 * 1024 * 1024 * 1024, // 1GB in bytes
    },
  },
};

Any help very much appreciated!

1 Like

Hi!!! Did you solve this? I am stuck in the same thing :frowning:

Looks like the default upload has a fixed limit of 200MB. I set up Minio as a S3-like storage and the problem no longer existed – at least until 1GB. Then again I run into a limitation which is hard-coded in node_modules/@strapi/plugin-upload/server/config.js :
sizeLimit: 1000000000, // 1GB

I changed it manually, and now I am able to upload files up to 10GB and more. In theory, you can configure this, but I failed so far. I added it to middlewares.ts, but that seems to be the wrong place.

Next limit might be a timeout by the strapi server. Also, if you have a proxy like Nginx, make sure you allow bigger files too:

default.conf

    sendfile on;
    client_max_body_size 10000M;
    client_body_buffer_size 10000M; 

Thanks so much for the reply!! I am still stuck and I want to avoid using something else like Minio, it should work with just S3 :frowning: ! I will attach a few screenshots in case you notice something I did not! Thanks a million!!!


Should not make much difference whether you use MinIO or AWS, they both follow the S3 protocol. Can’t spot any obvious errors in you screenshot – just make sure the environment variables are actually present and picked up by Strapi – it might just silently fail otherwise.

Did you manage to upload to AWS in general? Or do you only have the size limit issue? How big are the files you would like to upload?