uploadthing
uploadthing copied to clipboard
Unreliable MIME file types
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.