When I upload a PDF file, or a JS file, or anything non-image?, the type is set to text/plain
I couldn't reproduce this issue with PDF files, but with files as JavaScript it makes sense to have this set as text/plain.
What we need to know is map the mime type based on the file extension.
but with files as JavaScript it makes sense to have this set as text/plain.
Shouldn't it be application/javascript?
@rijkvanzanten that's correct. I was trying to say that if the server can't tell what the type of a file is based on its content we should base it on its extension (if any).
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
@WellingGuzman This doesn't seem like it would be that difficult to implement... but it's a high priority bug that has gone stale from inactivity. Any update on how long this would take to resolve?
This is a partial solution solved with https://github.com/directus/api/commit/b7f874bacb20b146fe6fb92408b2a09ef12a85c9.
It doesn't overwrite the value from the client.
Ideally we should have a list of mime type mapping to one or more extensions.
Most helpful comment
@rijkvanzanten that's correct. I was trying to say that if the server can't tell what the type of a file is based on its content we should base it on its extension (if any).