System Information
- Strapi Version: 4.3.6
- Operating System: Windows 11
- Database: sqlite on development mode and postgres on production
- Node Version: 16.14.0
- NPM Version: 8.3.1
- Yarn Version: 1.22.15
Hey everyone
I had an issue with uploading larger audio files using cloudinary provider in Strapi 4.
When file was uploded to the end, I waited small amount of time and received red screen inside uploader with X
and error:
On Strapi admin panel inside console, I received status 500:
I had also error like this: Error uploading to cloudinary: Server returned unexpected status code - 413
- basically this error appears in logs on web server on render.com.
Sometimes web server has status server failed and there is status info about that failure:
this is my middleware.js config and plugins.js config in development mode and also in env/production file for production mode:
name: 'strapi::security',
config: {
contentSecurityPolicy: {
useDefaults: true,
directives: {
'connect-src': ["'self'", 'https:'],
'img-src': ["'self'", 'data:', 'blob:', 'dl.airtable.com', 'res.cloudinary.com'],
'media-src': ["'self'", 'data:', 'blob:', 'dl.airtable.com', 'res.cloudinary.com'],
upgradeInsecureRequests: null,
},
},
},
},
And plugins config:
upload: {
config: {
provider: 'cloudinary',
providerOptions: {
cloud_name: env('CLOUDINARY_NAME'),
api_key: env('CLOUDINARY_KEY'),
api_secret: env('CLOUDINARY_SECRET'),
},
actionOptions: {
upload: {},
uploadStream: {},
delete: {},
},
},
}
One of the thing I’ve searched is that Cloudinary block uploading files greater than 100mb except of providing some configuration (see here: Programmatically Uploading Images, Videos, and Other Files | Cloudinary)
This is from the issue post from this source: https://support.cloudinary.com/hc/en-us/community/posts/360008228219-getting-Server-returned-unexpected-status-code-413-when-uploading-150MB-video
the fact is that I uploaded files with about 90mb ant it was fine, but above 100mb it couldn’t handle, so it is probably the case.
I also received a link to Strapi middleware configurations from someone, but I am trying to understand it yest to be honest.
https://docs.strapi.io/developer-docs/latest/setup-deployment-guides/configurations/required/middlewares.html#internal-middlewares-configuration-reference
I also want to mention that on development mode it also doesn’t work, so maybe it is a problem with cloudinary config settings to set it properly. Maybe it has some default restrictions for larger files, i don’t know. I hope someone could know where is the problem.
Appreciate anyones help