[asterisk-dev] Request for new MIME type in asterisk webserver
Edwin Groothuis
edwin at mavetju.org
Wed Mar 21 13:38:37 MST 2007
On Wed, Mar 21, 2007 at 04:45:05PM +0000, Tim Panton wrote:
> On 21 Mar 2007, at 14:59, Pari Nannapaneni wrote:
>
> >Hi all,
> >Can some one please add the following mime type in asterisk webserver.
> >
> >http.c
> >-------
> > mimetypes[] = {
> > { "png", "image/png" },
> > { "jpg", "image/jpeg" },
> > { "js", "application/x-javascript" },
> > { "wav", "audio/x-wav" },
> > { "mp3", "audio/mpeg" },
> >+ { "svg", "image/svg+xml" },
> and
> {"jar","application/java-archive"}
>
> please....
Instead of making another list, how about grabbing the information
a recognized source on the internet (Yes, this is metadata talk
from me :-)
For example, the FreeBSD Ports collection installs the file
/usr/local/etc/mime.types, about 700 lines of mime-type entries.
It comes from the file mime-support_3.39-1.tar.gz which is downloaded
from the Debian project:
ftp://ftp.us.debian.org/debian/pool/main/m/mime-support/
What Asterisk then can do is at startup, see if the file
/usr/local/etc/mime.types (or any other agreed on directory) exist
and read it in.
If that file doesn't exist, throw a warning and take a small list
from itself (.html, .png, .gif, .jpg, .wav and .mp3) and use
application/binary for others.
That way you prevent creating another huge list of mime-types, while
you still give everybody a chance to add lists of types without
recompiling everything.
Edwin
--
Edwin Groothuis | Personal website: http://www.mavetju.org
edwin at mavetju.org | Weblog: http://weblog.barnet.com.au/edwin/
More information about the asterisk-dev
mailing list