uploadthing icon indicating copy to clipboard operation
uploadthing copied to clipboard

Unreliable MIME file types

Open KairuDeibisu opened this issue 1 year ago • 0 comments

For the past week, I've been troubleshooting an issue.

issue

The issue is as follows,

Using a brand new app router project, with upload things installed as a dependency. Set up with the bare minimum configuration. I was able to upload images but unable to upload markdown documents.

I was also able to upload text documents but not marked down documents.

resolution

The resolution was opening the windows registry and adding the content type for text/markdown to the .md file type.

reflection

Looking at MDN documentation, developers should not solely rely on the MIME type for validation because depending on the client environment, It can be missing, or different than expected.

I've learned that some windows computers, for whatever reason, have some mime types missing. I don't believe we should expect end users to update their registry, if they're not able to upload some file types.

KairuDeibisu avatar Aug 15 '23 19:08 KairuDeibisu