DiscusWare, LLC.
Download Purchase Contact Us
Home
Support Home Documentation Knowledge Base Support Forums Support Request Advanced Services
How to add a new MIME type for attachment uploading

This document explains how you can configure Discus Pro 4.0 to recognize a MIME type for attachment uploading. Discus is distributed with recognition for most common MIME types; this document tells you how to add new ones.
Support Site Search
 
Introduction

The following document explains how to add a new recognized MIME type for Discus Professional attachment uploading. It is assumed that the reader has installed Discus Professional 4.0 and is reasonably comfortable with basic configuration operations (transferring files by FTP and editing text files) and with the basic use of a web browser. These instructions apply to Discus Professional 4.0 and higher only; they may not work in previous versions.

This tutorial will guide you through adding support for MP3 files to your attachments.conf file. This is presented as an example only, and you can repeat these steps with appropriate substitutions to add other MIME types.

Procedure
  1. Transfer the attachments.conf file from your server to your computer using ASCII mode, and open the attachments.conf file in a text editor such as Notepad.

  2. Using your browser, upload an attachment to your board that is of the MIME type that you want to add for recognition. In this example, we will upload a MP3 file to our board via the attachment uploading procedure. Once uploaded, click the link to the attachment and observe that the extension is .unk (why?).

  3. Move your mouse over the paper-click icon and observe the MIME type of the image as it pops up in the browser window. (The MIME type is stored in the ALT text for the image; if your browser does not display the MIME type, you'll need to look at the source of the page.)

    Attachment Configuration Image 1

  4. Add the MIME type, icon name, and desired extension between <Recognized> and </Recognized> in the attachments.conf file. In the case of the example above, the MIME type is "audio/mpeg" as was noted in step 3. For the icon, we will choose mime_wav.gif for now (maybe later we will create a new GIF just for MP3 files). For the extension, we will use the common mp3 extension. The line looks like this:

    audio/mpeg   mime_wav.gif   mp3

  5. Add the extension to the list of valid extensions between the <Valid> and </Valid> tags. The extension we've chosen is mp3 and is simply added on a line by itself between the aforementioned <Valid> and </Valid> tags.

    mp3

  6. OPTIONAL: If the extension you've added will be parsed for server side includes, add the extension between the <SSI> and </SSI> tags. Since MP3 files, like most other files, are not parsed for server side includes, we will not add "mp3" to this section.

  7. Save the attachments.conf file and transfer it back to your server using ASCII mode.

  8. Repeat the upload as in step 2. If you did everything correctly, you should see that the icon reflects the file type that you uploaded, and the extension has not been changed to "unk".

    Attachment Configuration Image 2

Recognizing extensions for unrecognized MIME types

It is possible that a visitor will be using a browser whose MIME types are broken, or at minimum, different from yours. What do you do, for example, if a user's browser thinks that MP3 files are "audio/x-application-winmedia-mp3" rather than "audio/mpeg"? One solution is to add the additional MIME types to your attachments.conf file, which is not a bad idea.

In advanced mode of Options Manager, under the security tab, there is an option for "Use file's extension for unrecognized MIME types if extension is valid." When checked and when a browser submits an unknown MIME type, Discus looks at the file name supplied by the browser. If the extension appears in the list of valid extensions (that you modified in step 5 above), the "unk" extension is not added. In the case of the example user from the previous paragraph, if the file had an extension of "mp3," that extension would be used on the file. Generally, this is desirable.

Additional Icons

From time to time, we receive suggestions along the lines of "you should add XXXXXXX MIME type to the file." Since it's possible to add your own MIME types, we do not change the default. However, we are pleased to post MIME types and icons (when available) here for your reference and use. The following information is supplied by Discus users, and is believed to be correct. Please submit changes or additions to DiscusWare via the support forum.

Icon MIME Type Extension
video/quicktime mov
video/x-ms-wmv wmv

Download Purchase Contact Us
Privacy Policy
Copyright © 2005, DiscusWare, LLC, All Rights Reserved