Does payload have the functionality to limit an image size within the upload field?

default discord avatar
MRL
3 months ago
2

I'm trying to force a user to upload an image size of only 100x100px. Can we set that in the upload itself so if they don't upload that size, it shows them an error?

  • default discord avatar
    Kyr
    3 months ago

    I think you can only do this on the media collection itself, not at the field level that I've found.



    Could be worth a suggestion on GitHub though as I think it would be generally very useful to be able to restrict uploads at the field level, both for image dimensions, file sizes and also mime-types.

  • default discord avatar
    MRL
    3 months ago

    Thanks @Kyr, I added a feature request here:

    https://github.com/payloadcms/payload/discussions/2083

    Feel free to upvote.

Open the post
Continue the discussion in Discord
Like what we're doing?
Star us on GitHub!

Star

Connect with the Payload Community on Discord

Discord

online

Can't find what you're looking for?

Get help straight from the Payload team with an Enterprise License.