发此博文原因是遇到一个 手机端读取服务器端.amr格式文件失败的例子。
反复测试发现从服务端无法播放,或下载.amr格式的文件。就想到可能是服务器站点托管服务 IIS不支持对.amr格式的解析,意思就是IIS无法对.amr格式文件解析出一个头信息,所以手机端自然也无法从头信息中知道这是个什么东西。流程 打开站点属性-----HTTP头---MIME添加---如下列表。
使用工具请求.amr文件 发现Content-Type出来,ok。解决问题。
答:浏览WAP网站与WEB网站都是需要服务器端和终端支持的,WEB网站的要求大家一般都知道了,
WAP网站需要的服务器只要在
WEB服务器的基础上稍加配置就可以使用,但是编写WAP网站所使用
的语言不同于WEB,通常使用WML语言配合ASP等脚本编写,
默认首页也一般为Index.asp/Index.wml/Default.asp/Default.wml等。
Windows2000 Server服务器配置IIS的MIME类型
地址:
Internet 服务管理器Internet 服务管理器-->主机属性-->计算机(MIME映射)-->编辑-->新类型
内容类型(MIME) 关联扩展名
text/vnd.wap.wml wml
image/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
IIS--默认网站属性-->http 头-->MIME映射 -->文件类型 -->新类型
.wml text/vnd.wap.wml
.wmlc application/vnd.wap.wmlc
.wmls text/vnd.wap.wmlscript
.wmlsc application/vnd.wap.wmlscriptc
.wbmp image/vnd.wap.wbmp
Apache安装目录下的conf/mime.types文件
增加:
text/vnd.wap.wml .wml
image/vnd.wap.wbmp .wbmp
application/vnd.wap.wmlc .wmlc
text/vnd.wap.wmls .wmls
application/vnd.wap.wmlsc .wmlsc
支持java下载:在iis中需要添加
.jad text/vnd.sun.j2me.app-descriptor
.jar application/java-archive
支持sis文件下载:在iis中需要添加
.sis application/vnd.symbian.install
.SISX同上
扩展名为.apk,MIME为application/vnd.android.package-archive
另外你还可以这样设:
下载型WAP服务器
--------------------------------
.mmf audio/mmf
.mfm audio/mfm
.pmd audio/pmd
.adp audio/adp
.amr audio/amr
.pmdaudio/pmd
.3gp video/3gpp
.cab application/vnd.smartpohone
.gif image/gif
.hme application/vnd.smartphone.thm
.jad text/vnd.sun.j2me.app-descriptor
.jar application/java-archive
.jpg image/jpeg
.mid audio/midi
.mp3 audio/x-mpeg
.mp4 video/mp4
.ogg application/ogg
.pdb application/ebook
.rm video/rm
.rng application/vnd.nokia.ringing-tone
.sdt application/vnd.sie.thm
.sis application/vnd.symbian.install
.thm application/vnd.eri.thm
.tsk application/vnd.ppc.thm
.umd application/umd
.utz application/vnd.uiq.thm
.wav audio/x-wav
.wbmp image/vnd.wap.wbmp
.wml text/vnd.wap.wml
.wmlc application/vnd.wap.wmlc
.wmls text/vnd.wap.wmlscript
.wmlsc application/vnd.wap.wmlscriptc
.wmv video/x-ms-wmv
.wsc application/vnd.wap/wmlscriptc
--------------------------------------------------------------------
一般WAP服务器
.wbmp image/vnd.wap.wbmp
.wml text/vnd.wap.wml
.wmlc application/vnd.wap.wmlc
.wmls text/vnd.wap.wmlscript
.wmlsc application/vnd.wap.wmlscriptc
.wmv video/x-ms-wmv
.wsc application/vnd.wap/wmlscriptc
.gif image/gif
.jpg image/jpeg
.bmp image/bmp
另外你还可以这样设:
下载型WAP服务器
--------------------------------
.mmf audio/mmf
.mfm audio/mfm
.pmd audio/pmd
.adp audio/adp
.amr audio/amr
.pmdaudio/pmd
.3gp video/3gpp
.cab application/vnd.smartpohone
.gif image/gif
.hme application/vnd.smartphone.thm
.jad text/vnd.sun.j2me.app-descriptor
.jar application/java-archive
.jpg image/jpeg
.mid audio/midi
.mp3 audio/x-mpeg
.mp4 video/mp4
.ogg application/ogg
.pdb application/ebook
.rm video/rm
.rng application/vnd.nokia.ringing-tone
.sdt application/vnd.sie.thm
.sis application/vnd.symbian.install
.thm application/vnd.eri.thm
.tsk application/vnd.ppc.thm
.umd application/umd
.utz application/vnd.uiq.thm
.wav audio/x-wav
.wbmp image/vnd.wap.wbmp
.wml text/vnd.wap.wml
.wmlc application/vnd.wap.wmlc
.wmls text/vnd.wap.wmlscript
.wmlsc application/vnd.wap.wmlscriptc
.wmv video/x-ms-wmv
.wsc application/vnd.wap/wmlscriptc
--------------------------------------------------------------------
一般WAP服务器
.wbmp image/vnd.wap.wbmp
.wml text/vnd.wap.wml
.wmlc application/vnd.wap.wmlc
.wmls text/vnd.wap.wmlscript
.wmlsc application/vnd.wap.wmlscriptc
.wmv video/x-ms-wmv
.wsc application/vnd.wap/wmlscriptc
.gif image/gif
.jpg image/jpeg
.bmp image/bmp