xml 如何解决“指定资源下载失败”错误?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12933511/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
how to solve "The download of the specified resource has failed" error?
提问by user475464
<%
set xd= server.createobject("msxml2.domdocument.6.0")
xd.async = false
xd.load("http://example.com/test.xml")
set errorlist= xd.selectnodes("/XMLResponse/ServiceList/")
if errorlist.length <> 0 then
response.write "FILE EXIST"
else
Response.Write xd.parseError.reason
end if
%>
when i run above code i getting error "The download of the specified resource has failed"
当我运行上面的代码时,我收到错误“指定资源的下载失败”
How to solve this?
如何解决这个问题?
回答by Lys777
I had the same problem and figured it was a permissions error (cross-domain maybe?) with accessing an RSS feed from another domain. I was able to pull up the contents of the RSS feed in my browser just fine. I have limited access to the server and it is highly secured, so I figured it was some security setting.
我遇到了同样的问题,并认为这是访问来自另一个域的 RSS 提要的权限错误(可能是跨域?)。我能够在我的浏览器中提取 RSS 提要的内容就好了。我对服务器的访问有限,而且它是高度安全的,所以我认为这是一些安全设置。
I found that this alternate approach allowed me to work around this:
我发现这种替代方法允许我解决这个问题:
Set xHttp = CreateObject("MSXML2.XMLHTTP")
xHttp.open "GET", "http://example.com/test.xml", False
xHttp.send
Set xd = Server.CreateObject("Microsoft.XMLDOM")
xd.loadxml(xHttp.responseText)
[rest of your code]
回答by Adarsh Madrecha
I also faced same issue,
我也遇到了同样的问题,
The problem was that because of some other things I was doing from the same box, I had exceeded the allowed limit of the Yahoo geocoding API. Once that was reset - the next day - it worked again as expected.
问题是因为我在同一个盒子里做的其他一些事情,我已经超出了雅虎地理编码 API 的允许限制。一旦重置 - 第二天 - 它再次按预期工作。
The error message that the download has "failed" was technically correct but not particularly descriptive. It seems like this is also a failure on Yahoo's API in that I wasn't being told explicitly (in XML) that I had exceeded the limit, it just wasn't returning anything.
下载“失败”的错误消息在技术上是正确的,但不是特别具有描述性。这似乎也是雅虎 API 的一个失败,因为我没有被明确告知(在 XML 中)我已经超过了限制,它只是没有返回任何东西。
回答by TradeMatic
I Updated Windows 7 to Windows 7 SP1 and Internet Explorer 8 to Internet Explorer 11. It solved the issue.
我将 Windows 7 更新为 Windows 7 SP1,将 Internet Explorer 8 更新为 Internet Explorer 11。它解决了这个问题。
回答by C. M. Sperberg-McQueen
Start by trying to find out whether the URI you are trying to dereference can be dereferenced successfully in other contexts.
首先尝试找出您尝试取消引用的 URI 是否可以在其他上下文中成功取消引用。
For example, try dereferencing it with a browser, or with curl or wget. If you can retrieve the resource with those tools, then your problem lies in the way you are asking ASP to retrieve it, and you need to look at the API documentation to see what you're doing wrong. If you can't retrieve the resource with those tools (curl http://example.com/test.xmlfails for me, for example), then the problem lies on the server side, and you have a different set of possible causes and a different road to solution.
例如,尝试使用浏览器、curl 或 wget 取消引用它。如果您可以使用这些工具检索资源,那么您的问题在于您要求 ASP 检索它的方式,您需要查看 API 文档以了解您做错了什么。如果您无法使用这些工具检索资源(curl http://example.com/test.xml例如,对我来说失败了),那么问题出在服务器端,您有一组不同的可能原因和不同的解决方法。

