Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

Upload field with filterOptions does not work with SVG

default discord avatar
0x4082 years ago
2
{
    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
    2 years ago

    Hi

    @105739105802944512

    - mimeType is looking for an exact match so change

    contains

    to

    equals

    and this should work for you.

  • default discord avatar
    szymciodrift6 months ago

    Is there any way to restrict file format to .svg during uploading new file?

Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get dedicated engineering support directly from the Payload team.