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.
我已经收到了“错误404.3没有找到”的JSON文件,我使用AJAX调用“Internet Information Services 7.5”,甚至在我激活了所有的“应用程序开发特性”之后。除了JSON文件之外,所有其他文件都被加载。
I am running an HTML page on IIS server on my local machine.
我正在本地机器上的IIS服务器上运行一个HTML页面。
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.
任何快速的帮助都将非常感谢。
8 个解决方案
#1
26
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.
您试图接收的文件是否在相同的域中?还是从其他服务器获取json ?如果它驻留在不同的域上,那么您将不得不使用JSONP,因为同源策略相同。
#2
80
As suggested by @ancajic i put the below code after connectionString tag in my web.config file and it worked.
正如@ancajic所建议的,我在我的web中把下面的代码放在connectionString标记之后。配置文件。
<system.webServer>
<staticContent>
<mimeMap fileExtension=".json" mimeType="application/json" />
</staticContent>
</system.webServer>
#3
26
As said by @elasticman, it is necessary to open IIS Manager -> Mime types -> Add a new mime type with
正如@ elasticity所说,有必要打开IIS Manager—> Mime类型—>添加一个新的Mime类型
Extension: .json MIME Type: application/json
扩展名:.json MIME类型: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.
但对我来说,这还不够。我有一个ASP。NET MVC 4应用程序,我需要修改我的根Web。配置文件。
Insert
插入
<staticContent>
<mimeMap fileExtension=".json" mimeType="application/json" />
</staticContent>
somewhere inside your
在你的地方
<system.webServer>
...
</system.webServer>
#4
7
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
如果您使用的是与Visual Studio一起使用IIS Express, IIS管理器将不能用于IIS Express。相反,您需要从%userprofile%\documents\IISExpress\config\applicationhost打开这个配置文件。配置和插入
<staticContent>
<mimeMap fileExtension=".json" mimeType="application/json" />
</staticContent>
along with all other pre-defined mime types.
与所有其他预定义的mime类型一起。
#5
6
I've applied the following settings on the IIS was right.
我在IIS上应用了以下设置。
1.Open IIS Manager
1。打开IIS管理器
2.Display properties for the IIS Server
2。显示IIS服务器的属性
3.Click MIME Types and then add the JSON extension:
3所示。单击MIME类型,然后添加JSON扩展:
File name extension: .json
文件扩展名:. json
MIME type: application/json
MIME类型:application / json
4.Go back to the properties for IIS Server
4所示。回到IIS服务器的属性
5.Click on Handler Mappings
5。单击处理程序映射
Add a script map
添加一个脚本映射
Request path: *.json
请求路径:* . json
Executable: C:\WINDOWS\system32\inetsrv\asp.dll Name: JSON
可执行:C:\WINDOWS\system32\inetsrv\asp.dll名称:JSON
#6
1
-
Go to IIs
去IIs
-
Select Website
选择网站
-
Double Click Mime Type Icon Under IIs
双击IIs下的Mime类型图标
-
Click Add Link in right hand side
点击右手边的添加链接
-
File Name Extension = .json Mime Type = application/json
文件名扩展名= .json Mime类型=应用/json
-
Click Ok.
单击Ok。
I hope your problem is resolve
我希望你的问题解决了
#7
0
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)
我没有遇到同样的问题,但是对于我(Windows Server 2003 IIS 6), MIME类型的应用程序/json不起作用。我使用文本/纯文本,并且工作得很好(您不需要重新启动服务器)
#8
0
To solve this problem with an Azure App Service:
通过Azure App服务解决这个问题:
Use FTP or the Kudu dashboard to add this file one level above wwwroot--
使用FTP或Kudu仪表板将此文件添加到wwwroot之上的一个级别—
/site/applicationHost.xdt:
/网站/ 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:
然后,在Azure Portal中的应用程序设置下,添加一个处理程序映射:
.json C:\WINDOWS\system32\inetsrv\asp.dll
#1
26
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.
您试图接收的文件是否在相同的域中?还是从其他服务器获取json ?如果它驻留在不同的域上,那么您将不得不使用JSONP,因为同源策略相同。
#2
80
As suggested by @ancajic i put the below code after connectionString tag in my web.config file and it worked.
正如@ancajic所建议的,我在我的web中把下面的代码放在connectionString标记之后。配置文件。
<system.webServer>
<staticContent>
<mimeMap fileExtension=".json" mimeType="application/json" />
</staticContent>
</system.webServer>
#3
26
As said by @elasticman, it is necessary to open IIS Manager -> Mime types -> Add a new mime type with
正如@ elasticity所说,有必要打开IIS Manager—> Mime类型—>添加一个新的Mime类型
Extension: .json MIME Type: application/json
扩展名:.json MIME类型: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.
但对我来说,这还不够。我有一个ASP。NET MVC 4应用程序,我需要修改我的根Web。配置文件。
Insert
插入
<staticContent>
<mimeMap fileExtension=".json" mimeType="application/json" />
</staticContent>
somewhere inside your
在你的地方
<system.webServer>
...
</system.webServer>
#4
7
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
如果您使用的是与Visual Studio一起使用IIS Express, IIS管理器将不能用于IIS Express。相反,您需要从%userprofile%\documents\IISExpress\config\applicationhost打开这个配置文件。配置和插入
<staticContent>
<mimeMap fileExtension=".json" mimeType="application/json" />
</staticContent>
along with all other pre-defined mime types.
与所有其他预定义的mime类型一起。
#5
6
I've applied the following settings on the IIS was right.
我在IIS上应用了以下设置。
1.Open IIS Manager
1。打开IIS管理器
2.Display properties for the IIS Server
2。显示IIS服务器的属性
3.Click MIME Types and then add the JSON extension:
3所示。单击MIME类型,然后添加JSON扩展:
File name extension: .json
文件扩展名:. json
MIME type: application/json
MIME类型:application / json
4.Go back to the properties for IIS Server
4所示。回到IIS服务器的属性
5.Click on Handler Mappings
5。单击处理程序映射
Add a script map
添加一个脚本映射
Request path: *.json
请求路径:* . json
Executable: C:\WINDOWS\system32\inetsrv\asp.dll Name: JSON
可执行:C:\WINDOWS\system32\inetsrv\asp.dll名称:JSON
#6
1
-
Go to IIs
去IIs
-
Select Website
选择网站
-
Double Click Mime Type Icon Under IIs
双击IIs下的Mime类型图标
-
Click Add Link in right hand side
点击右手边的添加链接
-
File Name Extension = .json Mime Type = application/json
文件名扩展名= .json Mime类型=应用/json
-
Click Ok.
单击Ok。
I hope your problem is resolve
我希望你的问题解决了
#7
0
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)
我没有遇到同样的问题,但是对于我(Windows Server 2003 IIS 6), MIME类型的应用程序/json不起作用。我使用文本/纯文本,并且工作得很好(您不需要重新启动服务器)
#8
0
To solve this problem with an Azure App Service:
通过Azure App服务解决这个问题:
Use FTP or the Kudu dashboard to add this file one level above wwwroot--
使用FTP或Kudu仪表板将此文件添加到wwwroot之上的一个级别—
/site/applicationHost.xdt:
/网站/ 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:
然后,在Azure Portal中的应用程序设置下,添加一个处理程序映射:
.json C:\WINDOWS\system32\inetsrv\asp.dll