-
Notifications
You must be signed in to change notification settings - Fork 32
How wordpress java determines mime types of uploaded media
Can Bican edited this page Jun 21, 2015
·
2 revisions
This is actually about how Java determines mime types of files.
As explained in here, mime types in java are determined in such a manner:
- The file .mime.types in the user's home directory.
- The file <java.home>/lib/mime.types.
- The file or resource named META-INF/mime.types.
- The file or resource named META-INF/mimetypes.default.
So, if you upload a file (say, a png file) and the mime type appears as
type:application/octet-stream
Just create a file ~/.mime.types and add an entry like this:
image/png png
Which should fix it.
A more general solution would be copying /etc/mime.types to ~/.mime.types, which contains a huge amount of file extensions.