I have been getting the "ERROR 404.3 Not Found" for JSON file that I am calling using AJAX call on "Internet Information Services 7.5" even after I have activated all the "Application Development Features". Other than JSON file, all other files are getting loaded.
I am running an HTML page on IIS server on my local machine.
If I open the file directly then there is no problem at all. When I host the files on an online server it works fine.
Any quick help will be much appreciated.
As suggested by @ancajic i put the below code after connectionString tag in my web.config file and it worked.
<system.webServer>
<staticContent>
<mimeMap fileExtension=".json" mimeType="application/json" />
</staticContent>
</system.webServer>
As said by @elasticman, it is necessary to open IIS Manager -> Mime types -> Add a new mime type with
Extension: .json MIME Type: application/json
But for me that still wasn't enough. I have an ASP.NET MVC 4 application, and I had to modify my root Web.config file.
Insert
<staticContent>
<mimeMap fileExtension=".json" mimeType="application/json" />
</staticContent>
somewhere inside your
<system.webServer>
...
</system.webServer>
Is the file you try to receive in the same domain? Or do you fetch the json from another server? If it is hosted on a different domain, you'll have to use JSONP due to same origin policy.
Option 1
Go to IIs
Select Website
Double Click Mime Type Icon Under IIs
Click Add Link in right hand side
File Name Extension = .json Mime Type = application/json
Click Ok.
Option 2
Update your web.config file like this
<system.webServer>
<staticContent>
<mimeMap fileExtension=".json" mimeType="application/json" />
</staticContent>
</system.webServer>
I hope your problem is resolved
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With