V8-archive: API sets wrong mime type

Created on 26 Oct 2018  路  6Comments  路  Source: directus/v8-archive

When I upload a PDF file, or a JS file, or anything non-image?, the type is set to text/plain

bug enhancement

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).

All 6 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

benhaynes picture benhaynes  路  31Comments

sayore picture sayore  路  39Comments

zeusstl picture zeusstl  路  26Comments

rijkvanzanten picture rijkvanzanten  路  25Comments

philleepflorence picture philleepflorence  路  33Comments