ERROR 404.3 Not Found for JSON file

JsonIisIis 7.5Http Status-Code-404Mime Types

Json Problem Overview


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.

Json Solutions


Solution 1 - Json

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>

Solution 2 - Json

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>

Solution 3 - Json

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.

Solution 4 - Json

Option 1

  1. Go to IIs

  2. Select Website

  3. Double Click Mime Type Icon Under IIs

  4. Click Add Link in right hand side

  5. File Name Extension = .json Mime Type = application/json

  6. 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

Solution 5 - Json

If you are using IIS Express with Visual Studio, IIS Manager won't work for IIS Express. Instead, you need to open this config file from %userprofile%\documents\IISExpress\config\applicationhost.config and insert

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

along with all other pre-defined mime types.

Solution 6 - Json

I've applied the following settings on the IIS was right.


1.Open IIS Manager

2.Display properties for the IIS Server

3.Click MIME Types and then add the JSON extension:

File name extension: .json

MIME type: application/json

4.Go back to the properties for IIS Server

5.Click on Handler Mappings

Add a script map

Request path: *.json

Executable: C:\WINDOWS\system32\inetsrv\asp.dll Name: JSON

Solution 7 - Json

I haven't the same problem but for me (Windows Server 2003 IIS 6) the MIME type application/json not work. I use text/plain and work perfect (You not need restart the server)

Solution 8 - Json

To solve this problem with an Azure App Service:

Use FTP or the Kudu dashboard to add this file one level above wwwroot--

/site/applicationHost.xdt:

<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
  <system.webServer>
    <staticContent>
      <mimeMap fileExtension=".json" mimeType="application/json" xdt:Transform="InsertBefore(/configuration/system.webServer/staticContent/*[1])" />
    </staticContent>
  </system.webServer>
</configuration>

Then, under Application settings in the Azure Portal, add a Handler mapping:

.json      C:\WINDOWS\system32\inetsrv\asp.dll

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionNitin SuriView Question on Stackoverflow
Solution 1 - JsonHimanshuView Answer on Stackoverflow
Solution 2 - JsonancajicView Answer on Stackoverflow
Solution 3 - JsonelasticmanView Answer on Stackoverflow
Solution 4 - JsonUdara KasunView Answer on Stackoverflow
Solution 5 - Jsonxqzh76View Answer on Stackoverflow
Solution 6 - JsonRasoolLotfiView Answer on Stackoverflow
Solution 7 - JsonAntonio Garcia MarinView Answer on Stackoverflow
Solution 8 - JsonBadHeuristicsView Answer on Stackoverflow