How do I change the MIME type for a file?

Solution 1:

To check if 'extension' mime type exist:

grep 'extension' /etc/mime.types

To create new mime type:

  1. Open /etc/mime.types with text-editor(with root privileges)

    gksudo gedit /etc/mime.types

  2. Add extension to /etc/mime.types in following format:

    text/extension extension

For more info click here

Solution 2:

Could be something as simple as a mangled/intentionally changed header. Here's what the MS Word first 2 chunks looks like in a couple of documents I just checked:

D0 CF 11 E0 A1 B1 1A E1

You could MAKE A BACKUP and try changing the first several bytes to that signature and see if it doesn't at least TRY to open as the right thing.

Generally, file can look at this area:
enter image description here
And tell the file-type. If it's detecting it wrong, either it actually is a text file renamed to doc or the header got borked.