Search

Get Paid to View Ad Pages
The Most Popular Traffic Exchange
PaidVerts
DonkeyMails.com: No Minimum Payout
WordLinx - Get Paid To Click

Sunday

Fixing Your Web Server's MIME Types

If, after putting the above code on your site and uploading your music file, your music does not automatically play in IE, Netscape or Opera, it is possible that your web server is not sending the browser the correct MIME type. In order for the browser to know how to handle the file, your web server needs to be configured to send the correct information about the file. For example, for MIDI files, the web server should send the browser a "Content-Type" header of "audio/midi".
You can find out if your server has been correctly configured by starting up Netscape, invoking the "View" menu and selecting the "Page Info" item on that menu. (I'm referring to version 4.7x of Netscape - the item may be labelled differently on other versions of Netscape.) The MIME type of your music file will be displayed (among other things).
If the MIME type is incorrect, contact your web host to have them fix it. If your website runs on an Apache web server, and your host has configured it to allow you to override its settings using a .htaccess file, you can set up the MIME type yourself. For example, if you have MIDI files with a file extension of ".midi", you might add the following line to your .htaccess file:
AddType audio/midi .midi
If you don't have any existing .htaccess file, you can simply create one using an ASCII text editor and upload it to the top directory of your website. Remember, Microsoft Word and Wordpad are *not* ASCII text editors. Also note that this method only works for Apache servers configured to allow .htaccess overrides. If this is not the case for you (for example, if your site runs on a Windows machine running IIS), you will probably have to get your web host to fix the problem.

Browser Plug-in Problems

Sometimes you may encounter a situation where the embedded code works for you but not for others using the same version of the same browser.
This situation may occur when the person has installed some other software that has replaced the default browser plug-in to handle the music file type. For example, various multimedia players (like QuickTime) replace the browser's default plugins when they are installed. The replacement plugins may not function in quite the same way as the default plugin for the browser, leading to your code not working as expected.
There's probably little you can do to prevent this from happening, short of posting notices everywhere on your site telling people not to install such-and-such a software, which is of course ludicrous. If you insist on putting auto-playing sound files on your web page, my recommendation is that you ensure that your page makes sense whether or not those sounds are played on your visitor's machine. That is, don't auto-play a sound file that provides vital information that the visitor needs to understand your web page - unless of course you also provide a clickable link on the page that allows him to hear the information should his browser not auto play the sound file.
Like many other aspects of coding for the web, putting music on the web requires a certain amount of defensive coding. Even then, there will probably be a percentage of visitors who will not be able to view/hear your site the way you intended.

No comments:

Post a Comment