Why is StaticFileHandler not a .json server?

We have a problem downloading .json files through IIS7.5.

The MIME type is set correctly:

 <mimeMap fileExtension=".json " mimeType="application/json" />

But still it gives an error: "HTTP Error 404.3 - Not Found."

To make it work, we need to add a handler mapping:

<handlers>
    <add name="JSON" path="*.json" verb="*" modules="IsapiModule" scriptProcessor="C:\WINDOWS\system32\inetsrv\asp.dll" resourceType="Unspecified" />
</handlers>

Why json files cannot be processed by StaticFileHandler, like other static content? It seems strange, we need to install classic asp support for processing json files.

+4
source share
2 answers

In my case, StaticFileHandler handles json itself. An asp.dll handler is not required.

The problem was the hidden end space in the fileExtension property:

<mimeMap fileExtension=".json " mimeType="application/json" />

Doh

+3
source

. .json MIME. json app_data. - , .

json , html .

, Mapping , Classic Asp ( Windows). .

+1

Source: https://habr.com/ru/post/1525461/


All Articles