Add the following to a web.config
file in the folder containing the files you wish to be served only as static content:
<configuration>
<system.webServer>
<handlers>
<clear />
<add
name="StaticFile"
path="*" verb="*"
modules="StaticFileModule,DefaultDocumentModule,DirectoryListingModule"
resourceType="Either"
requireAccess="Read" />
</handlers>
<staticContent>
<mimeMap fileExtension=".*" mimeType="application/octet-stream" />
</staticContent>
</system.webServer>
</configuration>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…