Wap中常用的 MIME Type
Apache 是一个优秀的应用服务器程序,已经提供了对一般WAP的支持。
如果你不确定你的Apache是否配置好了WAP支持,可以看一下Apache的配置文件"mime.types"。如果配置文件中这么一行:
text/vnd.wap.wml wml
如果没有的话,也不用着急,加上这一行就行了。如果你要配置全面一些的话还要加上以下几行:
p_w_picpath/vnd.wap.wbmp wbmp
text/vnd.wap.wmls wmls
application/vnd.wap.wmlc wmlc
application/vnd.wap.wmlscriptc wmlsc
text/vnd.wap.wmlscript wsc
text/vnd.wap.wmlscript wmlscript
修改好以后,重新启动Apache就可以了。
如果要系统支持index.wml的话,还得配置Apache的httpd.conf,类似添加index.php的配置了,略。
只所以说支持的是一般WAP,像一些安装文件jar,jad,sis之类的安装文件就没有默认支持。
如果要使Apache支持OTA(WAP PUSH)下载的话,还得在mime.types中添加下面几行:
AddType p_w_picpath/vnd.nokia.ota-bitmap ota
AddType text/vnd.sun.j2me.app-descriptor jad
AddType application/java-archive jar
AddType application/vnd.Nokie.ringing-tone rng
AddType application/vnd.symbian.install sis
(不加的话,下载类似sis的安装文件会直接打开该文件,而不会直接执行。)
更详细的文件类型配置如下:
AddType text/vnd.sun.j2me.app-descriptor jad
AddType application/java-archive jar
AddType text/vnd.wap.wml wml
AddType audio/amr amr
AddType audio/midi mid
AddType audio/midi midi
AddType application/vnd.Nokie.ringing-tone rng
AddType application/vnd.symbian.install sis
AddType application/vnd.wap.wmlc wmlc
AddType text/vnd.wap.wmlscript wmls
AddType text/vnd.wap.wmlscript wmlsc
AddType application/vnd.wap.sic sic
AddType text/vnd.wap.si si
AddType text/vnd.wap.sl sl
AddType application/vnd.wap.slc slc
AddType text/x-vCalendar vcs
AddType text/v-vCard vcf
AddType application/vnd.nokia.gamedata nqd
AddType application/x-nokiagamedata ngd
AddType p_w_picpath/vnd.wap.wmbp wbmp
AddType p_w_picpath/x-bmp bmp
AddType p_w_picpath/x-epoc-mbm mbm
AddType p_w_picpath/vnd.nok-3dscreensaver n3a
AddType text/x-co-desc cod
AddType p_w_picpath/vnd.nok-oplogo-colornokia-op-logo nok
AddType application/x-pmd .pmd
AddType audio/vnd.qcelp .qcp
AddType application/x-smaf .mmf
AddType application/vnd.smaf
保存后,重启下Apache,OK了
MIME Type 增补
Built-in Mime-Types (for MP3) mime1type = "Content-type: audio/mp3\n\n";
mime2type = "Content-type: audio/mpeg\n\n";
mime3type = "Content-type: audio/x-mp3\n\n";
mime4type = "Content-type: audio/x-mpeg\n\n";
mime5type = "Content-type: audio/m3u\n\n";
mime6type = "Content-type: audio/x-m3u\n\n";