Upload field with filterOptions does not work with SVG

default discord avatar
Morkvitnir
2 months ago
1
{
    name: "logo",
    type: "upload",
    relationTo: "logos",
    filterOptions: {
        mimeType: { contains: "image/svg+xml" }
    },
    required: true
}


Neither SVG images show up in the Admin Panel, nor can I upload new SVGs to the field.

  • discord user avatar
    jesschow
    Payload Team
    2 months ago

    Hi @Morkvitnir - mimeType is looking for an exact match so change

    contains

    to

    equals

    and this should work for you.

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.