Tuesday 14 May 2013

Add .json file in asp.net web.config file



 How can I enable the download of *.json files from an old ASP.NET site (IIS6 I am led to believe)?
 I am getting a 404 page instead of the JSON file.
 Do I need to create a web.config file? What goes in it?

you can just add the following to your web.config in the system.webServer section:
<staticContent>
    <mimeMap fileExtension=".json" mimeType="application/json" />
</staticContent>

No comments:

Post a Comment