block image upload when its size in pixels is less than x #25038
Replies: 2 comments
-
|
Moved discussion to the Strapi Backend Q&A Section, the Community Guides section isn't for questions. |
Beta Was this translation helpful? Give feedback.
-
|
@xazalo you can use a middleware to do that. Create a file called Then you can add it to the That should do the trick. Note that it is also possible to register a middleware only for a specific route instead of globally like in my example here. The Rest Cache plugin is a good example of how you'd do that, see https://github.com/strapi-community/plugin-rest-cache/blob/main/packages/plugin-rest-cache/server/src/utils/middlewares/injectMiddlewares.js |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm creating a page for my customer who needs to upload images. The system should create small, medium, and large versions of each image. However, if someone tries to upload an image smaller than 800px, I want to block the upload entirely to prevent it from being processed. Is there a way to do this?
Beta Was this translation helpful? Give feedback.
All reactions