payloadcms / payload

The best way to build a modern backend + admin UI. No black magic, all TypeScript, and fully open-source, Payload is both an app framework and a headless CMS.
https://payloadcms.com
MIT License
21.59k stars 1.3k forks source link

Illustrator file is not uploadable #6348

Open patricsgamma opened 2 months ago

patricsgamma commented 2 months ago

Link to reproduction

-

Describe the Bug

Setup

Adobe Illustrator files come with 1 of 2 mimeType's, where pdf one is the recent one. application/vsn.adobe.illustrator, application/pdf

Error

Configuring an upload collection allowing both, still doesn't let me upload an Illustrator .ai file.

We receive a ValidationError: The following field is invalid: mimeType

Out of some reason the file is interpreted as a 'application/postscript' even though getting File infos tells us its a pdf

file --mime-type -b my_illustrator_file.ai 
application/pdf

To Reproduce

Configure a upload collection with

 upload: {
    mimeTypes: [
      'application/vsn.adobe.illustrator',
      'application/pdf',
    ],
  },

Try to upload an illustrator file.

Payload Version

2.16.1

Adapters and Plugins

"@payloadcms/bundler-webpack": "^1.0.6", "@payloadcms/db-mongodb": "^1.5.1", "@payloadcms/plugin-cloud-storage": "^1.1.2", "@payloadcms/plugin-sentry": "^0.0.6", "@payloadcms/richtext-lexical": "^0.10.0",

patricsgamma commented 2 months ago

With the knowledge that 'application/postscript' works we can get around the issue. But its still strange and misleading when the OS tells you a file is a certain mimeType and then it turns to something different on upload into the CMS.