MimeTypes.rdf: Difference between revisions

From MozillaZine Knowledge Base
Jump to navigationJump to search
m (→‎Related bugs: Summary for bug 308204 was changed)
(→‎Editing: removed obsolete Thunderbird hack)
 
(13 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{profile-file|filename=mimeTypes.rdf}}
{{profile-file|filename=mimeTypes.rdf}}


mimeTypes.rdf stores information on which action to perform when opening certain kinds of files - open in a specific program or download it, perform the action automatically, etc. In Firefox, this information can be viewed in Tools -> Options -> Downloads -> View & Edit Actions....
''mimeTypes.rdf'' stores information about which action is to be performed when downloading certain types of files, such as opening the file in a specific program or saving it to disk. In Firefox, this information can be viewed or changed in "[[Menu differences in Windows, Linux, and Mac|Tools -> Options]] -> Content / File Types -> Manage..."; in Thunderbird, in "Tools -> Options -> Attachments / Download Actions -> View & Edit Actions...";  and in Mozilla Suite and SeaMonkey, in "[[Menu differences in Windows, Linux, and Mac|Edit -> Preferences]] -> Navigator -> Helper Applications".


==Editing==
==Editing==
It's not advisable to edit this file manually because of its complexity and the fact that, in Firefox, the Options dialog provides an interface to edit it. Should you want to edit it manually anyway...
In general, it is not advised to edit this file manually because of its complexity and the fact that interfaces are provided to edit it in Firefox, Thunderbird, and SeaMonkey. Note that build-in handlers or plug-ins may have precedence over the settings in mimeTypes.rdf.


The file is an RDF document containing one RDF:Seq and many RDF:Descriptions (one for each [[MIME types | MIME type]]). Each entry has an identifier - the attribute RDF:about. To delete an entry, delete both its RDF:li in the RDF:Seq and its RDF:Description. To change an entry, simply change the RDF:Description's attributes (do not change RDF:about). To add an entry, insert a new RDF:li into the RDF:Seq and create a new RDF:Description, making sure their identifiers match.
The file is an RDF document containing one RDF:Seq and many RDF:Descriptions (one for each [http://developer.mozilla.org/en/docs/Properly_Configuring_Server_MIME_Types MIME type]). Each entry has an identifier - the attribute RDF:about. To delete an entry, delete both its RDF:li in the RDF:Seq and its RDF:Description. To change an entry, simply change the RDF:Description's attributes (do not change RDF:about). To add an entry, insert a new RDF:li into the RDF:Seq and create a new RDF:Description, making sure their identifiers match.


===Attributes===
===Attributes===
Line 18: Line 18:
** NC:path - path of the application to use to open this file
** NC:path - path of the application to use to open this file
** NC:useSystemDefault - true (use the system default for this MIME type) or false (define a different action)
** NC:useSystemDefault - true (use the system default for this MIME type) or false (define a different action)
** NC:saveToDisk - true (default action is "download to disk") or false (don't download by default)
* Additional options
* Additional options
** NC:alwaysAsk - true (always ask which action to perform) or false (don't ask which action to perform)
** NC:alwaysAsk - true (always ask which action to perform) or false (don't ask which action to perform)
* Unknown
** NC:editable - true (entry can be modified with user interface) or false (entry is locked)
** NC:editable
** NC:prettyName - the short (display) name of the application
** NC:prettyName
 
===Example===
These entries result in "Paint" always to be used as the application to open PNG images on Windows. While this works with Thunderbird, it wouldn't have any effect in SeaMonkey as it has an internal mechanism to handle PNG files. Only if the server requests explicitly a content disposition of "attachment", both Firefox and SeaMonkey will present the dialog proposing the defined action, regardless of the "NC:alwaysAsk" setting.
 
<pre>
<?xml version="1.0"?>
<RDF:RDF xmlns:NC="http://home.netscape.com/NC-rdf#"
        xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
 
  <RDF:Seq RDF:about="urn:mimetypes:root">
...
    <RDF:li RDF:resource="urn:mimetype:image/png"/>
...
  </RDF:Seq>
 
  <RDF:Description RDF:about="urn:mimetype:image/png"
                  NC:fileExtensions="png"
                  NC:description="PNG Image"
                  NC:value="image/png"
                  NC:editable="true">
    <NC:handlerProp RDF:resource="urn:mimetype:handler:image/png"/>
  </RDF:Description>
 
  <RDF:Description RDF:about="urn:mimetype:handler:image/png"
                  NC:alwaysAsk="false"
                  NC:saveToDisk="false"
                  NC:useSystemDefault="false"
                  NC:handleInternal="false">
    <NC:externalApplication RDF:resource="urn:mimetype:externalApplication:image/png"/>
  </RDF:Description>
 
  <RDF:Description RDF:about="urn:mimetype:externalApplication:image/png"
                  NC:path="C:\WINDOWS\system32\mspaint.exe"
                  NC:prettyName="mspaint.exe" />
</RDF:RDF>
</pre>


==Moving==
==Moving==
This file can be moved to a different profile. If some MIME types specify a path for a program to use, this path must be correct on the destination profile's system.
This file can be moved to a different [[profile folder|profile]]. If some MIME types specify a path for a program to use, this path must be correct on the destination profile's system.


==Deleting==
==Deleting==
Line 31: Line 67:


==Related bugs==
==Related bugs==
* [https://bugzilla.mozilla.org/show_bug.cgi?id=57342 Bug 57342 - Add "View as Text/HTML/..." option for unknown mime content-type]
* [https://bugzilla.mozilla.org/show_bug.cgi?id=58554 Bug 58554 - Support using external programs to show non-inlined images and other content]
* [https://bugzilla.mozilla.org/show_bug.cgi?id=264492 Bug 264492 - OK button in (open with/save to) window is greyed/grayed/disabled when certain mimeTypes.rdf entries exist]
* [https://bugzilla.mozilla.org/show_bug.cgi?id=264492 Bug 264492 - OK button in (open with/save to) window is greyed/grayed/disabled when certain mimeTypes.rdf entries exist]
* [https://bugzilla.mozilla.org/show_bug.cgi?id=308204 Bug 308204 - null description in helper version info leaves Download Actions blank]
* [https://bugzilla.mozilla.org/show_bug.cgi?id=308204 Bug 308204 - null description in helper version info leaves Download Actions blank]
* [https://bugzilla.mozilla.org/show_bug.cgi?id=311138 Bug 311138 - Already defined download actions are not listed in the download actions window]
* [https://bugzilla.mozilla.org/show_bug.cgi?id=311138 Bug 311138 - Already defined download actions are not listed in the download actions window]
* [https://bugzilla.mozilla.org/show_bug.cgi?id=462629 Bug 462629 - Cannot access MIME-type and file associations in new Helper Applications pane]


==See also==
==See also==
* [[File types and download actions]]
* [[Actions for attachment file types]]
* [[Open File dialog has the OK button grayed out]]
* [[Open File dialog has the OK button grayed out]]
* [[MIME types]]





Latest revision as of 13:36, 11 August 2011

mimeTypes.rdf stores information about which action is to be performed when downloading certain types of files, such as opening the file in a specific program or saving it to disk. In Firefox, this information can be viewed or changed in "Tools -> Options -> Content / File Types -> Manage..."; in Thunderbird, in "Tools -> Options -> Attachments / Download Actions -> View & Edit Actions..."; and in Mozilla Suite and SeaMonkey, in "Edit -> Preferences -> Navigator -> Helper Applications".

Editing

In general, it is not advised to edit this file manually because of its complexity and the fact that interfaces are provided to edit it in Firefox, Thunderbird, and SeaMonkey. Note that build-in handlers or plug-ins may have precedence over the settings in mimeTypes.rdf.

The file is an RDF document containing one RDF:Seq and many RDF:Descriptions (one for each MIME type). Each entry has an identifier - the attribute RDF:about. To delete an entry, delete both its RDF:li in the RDF:Seq and its RDF:Description. To change an entry, simply change the RDF:Description's attributes (do not change RDF:about). To add an entry, insert a new RDF:li into the RDF:Seq and create a new RDF:Description, making sure their identifiers match.

Attributes

  • General
    • RDF:about - identifier
    • NC:description - the name of the file type that will be displayed on the download prompt
  • Choosing what to handle
    • NC:fileExtension - file extensions to handle (note that content downloaded from the Internet will go by MIME type, not by file extension)
    • NC:value - MIME type to handle
  • Choose how to handle it (absence of the following options means "download to disk")
    • NC:path - path of the application to use to open this file
    • NC:useSystemDefault - true (use the system default for this MIME type) or false (define a different action)
    • NC:saveToDisk - true (default action is "download to disk") or false (don't download by default)
  • Additional options
    • NC:alwaysAsk - true (always ask which action to perform) or false (don't ask which action to perform)
    • NC:editable - true (entry can be modified with user interface) or false (entry is locked)
    • NC:prettyName - the short (display) name of the application

Example

These entries result in "Paint" always to be used as the application to open PNG images on Windows. While this works with Thunderbird, it wouldn't have any effect in SeaMonkey as it has an internal mechanism to handle PNG files. Only if the server requests explicitly a content disposition of "attachment", both Firefox and SeaMonkey will present the dialog proposing the defined action, regardless of the "NC:alwaysAsk" setting.

<?xml version="1.0"?>
<RDF:RDF xmlns:NC="http://home.netscape.com/NC-rdf#"
         xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#">

  <RDF:Seq RDF:about="urn:mimetypes:root">
...
    <RDF:li RDF:resource="urn:mimetype:image/png"/>
...
  </RDF:Seq>

  <RDF:Description RDF:about="urn:mimetype:image/png"
                   NC:fileExtensions="png"
                   NC:description="PNG Image"
                   NC:value="image/png"
                   NC:editable="true">
    <NC:handlerProp RDF:resource="urn:mimetype:handler:image/png"/>
  </RDF:Description>

  <RDF:Description RDF:about="urn:mimetype:handler:image/png"
                   NC:alwaysAsk="false"
                   NC:saveToDisk="false"
                   NC:useSystemDefault="false"
                   NC:handleInternal="false">
    <NC:externalApplication RDF:resource="urn:mimetype:externalApplication:image/png"/>
  </RDF:Description>

  <RDF:Description RDF:about="urn:mimetype:externalApplication:image/png"
                   NC:path="C:\WINDOWS\system32\mspaint.exe"
                   NC:prettyName="mspaint.exe" />
</RDF:RDF>

Moving

This file can be moved to a different profile. If some MIME types specify a path for a program to use, this path must be correct on the destination profile's system.

Deleting

Deleting mimeTypes.rdf will clear the associations between MIME types and programs. A new file will be created on start up or when the application first needs to write to the file.

Related bugs

See also