Cannot download .json files

I get this error “HTTP Error 404.3 - Not Found. The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map.” (Handler: StaticFile, Error code: 0x80070032), while requesting a .json file.

Try this url to see the error
http://mrp.gear.host/front-end/gui/Product_grid.json

I definitely need to support .json files. How can I add a .json mime map?

Hello! Check out this link on stack overflow http://stackoverflow.com/questions/8158193/how-to-allow-download-of-json-file-with-asp-net it shows the code you need in the top comment.

Thanks ICrow. Most advice in that webpage cannot be followed because we don’t have access to IIS inetmgr here. I added

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

to my web.config and it works now.

Hey Jake!
I still don’t understand how to solve that. can you help me? I really don’t know where web.config need add.

Hello @loidichienthang ,

You need to create a web.config file under /site/wwwroot/

@Monroy
Thanks for your help. I got this solution. because I don’t know .NET.
I create a web.config file under wwwroot and add.

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

but it’s not working. I guess everyone same me don’t know .NET will not work, too.

I share my way for anyone need that

create web.config live under wwwroot with content

<?xml version="1.0"?>
<configuration>
  <system.web>
    <compilation debug="true" targetFramework="4.0"/>
  </system.web>
  <system.webServer>
    <staticContent>
      <mimeMap fileExtension=".json" mimeType="application/json" />
    </staticContent>
  </system.webServer>
</configuration>

good luck,

Try adding the Remove rule first before MimeMap, i.e :

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