Unity文件对应的mime类型

Unity文件对应的mime类型


unity打包发布到web上时,如果需要下载资源文件,需要设置文件所对应的mime类型,有两种方法
一,手动在 开始-〉控制面板-〉性能和维护-〉管理工具-〉双击Internet信息服务,才打开IIS管理器。找到对应的网络双击MIME类型,然后添加。
二,在服务器上的资源文件夹里面创建一个web.config文件,内容如下即可,自动创建相对应的MIME类型。

注意:
IIS - 无后缀(无扩展名)的MIME类型配置
文件扩展名:.
MIME类型:application/octet-stream


<configuration>
    <system.webServer>
        <staticContent>
            <mimeMap fileExtension=".unity3d" mimeType="application/octet-stream" />
            <mimeMap fileExtension=".unityweb" mimeType="application/binary" />
			<remove fileExtension=".mem" />
			<mimeMap fileExtension=".mem" mimeType="application/octet-stream" />
			<remove fileExtension=".data" />
			<mimeMap fileExtension=".data" mimeType="application/octet-stream" />
			<remove fileExtension=".memgz" />
			<mimeMap fileExtension=".memgz" mimeType="application/octet-stream" />
			<remove fileExtension=".datagz" />
			<mimeMap fileExtension=".datagz" mimeType="application/octet-stream" />
			<remove fileExtension=".unity3dgz" />
			<mimeMap fileExtension=".unity3dgz" mimeType="application/octet-stream" />
			<remove fileExtension=".jsgz" />
			<mimeMap fileExtension=".jsgz" mimeType="application/x-javascript; charset=UTF-8" />
			<remove fileExtension=".lua" />
            <mimeMap fileExtension=".lua" mimeType="text/x-lua" />
			<remove fileExtension=".assetbundle" />
            <mimeMap fileExtension=".assetbundle" mimeType="application/octet‐stream" />
			<remove fileExtension=".txt" />
            <mimeMap fileExtension=".txt" mimeType="application/octet‐stream" />
			<remove fileExtension=".manifest" />
            <mimeMap fileExtension=".manifest" mimeType="application/octet‐stream" />
			<remove fileExtension=". " />
            <mimeMap fileExtension=". " mimeType="application/octet‐stream" />
			<remove fileExtension=".*" />
            <mimeMap fileExtension=".*" mimeType="application/octet‐stream" />\
			<remove fileExtension="." />
            <mimeMap fileExtension="." mimeType="application/octet‐stream" />
        staticContent>
    system.webServer>
configuration>

你可能感兴趣的:(Unity,lua,unity,web)