Theo's Typesafe CultTTC
Theo's Typesafe Cult2y ago
2 replies
Zoidy

Shared MimeType config for Uploadthing

Hi, I would like to define allowed MimeType - .jpeg, .png, .pdf and also I would like to define min and max file count, but shared across the mime types.
e.g. I have minimum 5 files and maximum 10, so I would like to be able to select 3x .pngs, 2x .jpegs and 1x .pdf
I currently defined the router config like this
"image/jpeg": { maxFileSize: "8MB", minFileCount: 5, maxFileCount: 10 },
    "image/png": { maxFileSize: "8MB", minFileCount: 5, maxFileCount: 10 },
    "application/pdf": {
      maxFileSize: "8MB",
      minFileCount: 5,
      maxFileCount: 10,
    }

But it looks like it takes the validation for each Mime type
Was this page helpful?