LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how do I change mime type? (https://www.linuxquestions.org/questions/linux-newbie-8/how-do-i-change-mime-type-22024/)

brian_eye 05-28-2002 03:56 PM

how do I change mime type?
 
I have a file1.sxc file which is an OpenOffice spreadsheet. I CAN open this file by first running OpenOffice and then opening the file from OpenOffice. I WANT TO open this file by clicking on it. Unfortunately, in file properties, this file is identified with the MIME type "application/zip", which is wrong. Furthermore, the MIME type "application/zip" is NOT identified with the .sxc extension in my GNOME control center. If I open this file in OpenOffice and do a "save as" .sxc file, I still get the "application/zip" MIME type.

How do I edit the MIME type of this file to change it from "application/zip" to "application/vnd.sun.xml.calc", which I think is what I want?

In general, my question is, How do you edit the file properties to give a file a different MIME type, other than by simply changing the file extension?

Thanks for any responses.

Bert 06-10-2002 04:19 AM

I think that this thread will tell you how to do it.

Bert

brian_eye 06-10-2002 09:14 AM

update
 
My version of Gnome that came with RH 7.2 does NOT allow one to DEselect the "detect file types by their mime types rather than their extension" option as described by Calum in his posting.

My particular problem happened because Gnome File Types and Programs was not properly handling the .sxc (spreadsheet) and .sxw (word processor) file types, even though the .sxc and .sxw extensions were explicitly associated with OpenOffice 1.0 in "File Types and Programs". All my .sxc and .sxw files were being interpreted as type "application/zip". As a result, I couldn't get OpenOffice to appear in the application menu when I right-clicked a .sxc or .sxw file.

My work-around was to delete the line containing "application/zip" from the file /etc/gnome-vfs-mime-magic. Apparently, Gnome has a "magic" file-type interpreter which interprets the file-type based on information other than the file extension. This "magic" interpreter seems to override what is in "File Types and Programs". Deleting that line from /etc/gnome-vfs-mime-magic seems to allow the Gnome "File types and programs" entries related to .sxc and .sxw to work properly.


All times are GMT -5. The time now is 03:54 AM.