ERROR 404.3 Not Found for JSON file

52,554

Solution 1

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 2

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 3

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 4

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

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.

Share:
52,554
Nitin Suri
Author by

Nitin Suri

Nitin is a passionate frontend developer who enjoys building creative interactive interfaces for digital platforms and applications that help organizations connect with the end consumer, as part of digital transformation journey. He has the expertise in frontend architecture and development for large-scale projects. Nitin is proficient in developing performant, scalable, maintainable, responsive, and cross-browser code that is SEO friendly and adhering to various accessibility using the latest technologies like HTML5, CSS3, jQuery, ReactJs, LESS, SASS. I like to be at the confluence of design and technology, with user experience being the perfect synergy for my skills. Coming from designing background Nitin is a great mix of creativity, user-experience, and technology. He loves playing around building user interactive experiences. Evangelizing the merits of best practices of frontend techniques such as responsive design, reusable component libraries and accessibility.

Updated on July 05, 2022

Comments

  • Nitin Suri
    Nitin Suri almost 2 years

    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.

  • Nitin Suri
    Nitin Suri about 11 years
    it's the same domain, below is the folder structure: root folder index.html - data/data.json - js/js.js
  • elasticman
    elasticman about 11 years
    Okay, the problem is that IIS has no JSON-File type by default (MIME) so you have to set it up: To set this for the entire server: 1. Open properties for your server in your IIS Manager and go for MIME Types. 2. Use "New" and enter "JSON" as extension and "application/json" for MIME.
  • Nitesh
    Nitesh about 10 years
    thanks elasticman, iis has no json file type and does not recognise it.
  • Rich Finelli
    Rich Finelli about 9 years
    Thanks I was having trouble figuring out where to put <staticContent> and knowing to put it inside of <system.webServer> was what made it work! Thanks!
  • userJT
    userJT about 7 years
    where do I find web.config file?
  • hi0001234d
    hi0001234d almost 5 years
    great! saved my hours!