Web design, programming, graphics, and pretty much anything else I care about.

webfm

WebFM and mime types

WebFM calls the deprecated mime_content_type() function which returned the file type for MP4s as text/plain rather than video/mp4. The file /etc/httpd/conf/magic had to be modified by adding 2 lines:

4   string   ftypmp42   video/mp4
4   string   ftypisom   video/mp4

To verify that this worked:

echo "<?php echo mime_content_type('/mnt/video/PA/Walzer.hi.mp4'); ?>" | php

returned

video/mp4

(it returned text/plain before the change)

WebFM icons

WebFM uses multiple methods for determining what type of file it is dealing with, and thus, what icon to display. When inserting a file into the database it used the php function mime_get_content to determine the type of file. If this function does not exist WebFM uses its own function to determine the mime type. This function is in the webfm_mime_types.inc file. Basically, it just goes by the file extension.