Change upload size limit not working?

System Information
  • Strapi Version: 4.9.1
  • Operating System: Windows Server 2019
  • Database: MySQL
  • Node Version: 18.13.0
  • NPM Version: 8.19.3
  • Yarn Version:

Hi,

I have raised the upload sizelimit in my strapi application to 50MB in my config/plugins.js

module.exports = ({ env }) => ({
	upload: {
		config: {
		  sizeLimit: 52428800 // 50mb in bytes (binary)
		}
	},
    bulkoperator: {
      enabled: true,
      resolve: "strapi-bulk-operator",
    }
    // ...
  });

I can upload files of 16MB etc but when trying to upload a file of 45MB now it still returns me a 413 error payload too large. What am I doing wrong?

Hey @jarmo,

Well, I in my case I had to add this below code in middleware.js to make it work

module.exports = [
  {
    name: 'strapi::security',
    config: {
      formidable: {
        config: {
          formLimit: "5mb", // modify form body
          jsonLimit: "5mb", // modify JSON body
          formidable: {
            maxFileSize: 5 * 1024 * 1024, // multipart data, modify here limit of uploaded file size
          },
        },
      },
    },
  }
];