Configure Multipurpose Internet Mail Extensions (MIME)
types to file extensions.
Before you begin
To edit configuration
files, you must use the IBM® WebSphere® Application Server
wsadmin client. For more information, see Starting the wsadmin client.
About this task
You can configure Wikis to assign specific MIME types
to files with specific extensions. A MIME type informs operating systems
about what applications to use to open the file types, and what applications
to display in dialog boxes. MIME types make it easier for users to
know at a glance what type of data a file contains. Some applications
do not download files that do not have a MIME type that they support.
This
configuration procedure applies to files attached to Wikis pages through
the web user interface. The configuration is ignored if a third-party
application assigns MIME types to extensions by using the API. For
information about assigning MIME types through the API, see the Wikis
API topic.
Procedure
- Start the wsadmin client.
- Start the Wikis Jython script interpreter.
- Use the following command
to access the Wikis configuration files:
execfile("wikisAdmin.py")
If
you are asked to select a server, you can select any server.
- Check out the Wikis configuration
files using the following command:
WikisConfigService.checkOutConfig("working_directory",
"cell_name")
where:
For example:
WikisConfigService.checkOutConfig("/opt/my_temp_dir", "CommServerNode01Cell")
- Go to the working directory that is specified in Step 2b
and open the
mime-wikis-config.xml
file. The content
of the file is similar to the following excerpt:<mapping mimeType="..." mediaType="...">
<extension></extension>
<extension></extension>
....
</mapping>
- In the mimeType attribute, specify a mime type in standard
format, for example
text/plain
. Each value must be
unique or an error is returned when you start the system. Go to the Internet
Assigned Numbers Authority (IANA) website for a list of MIME
types.Note: The mediaType attribute is not supported in
this release.
- In each extension element, specify the extensions that
you want to map to the MIME type. Each value must be unique or an
error is returned when you start the system.
- Apply the changes. For more information, see Applying
Wikis property changes.
Example
<mapping mimeType="text/plain" mediaType="">
<extension>.txt</extension>
....
</mapping>