简体   繁体   English

使用WebApi和IE8 / 9的Kendo文件上传错误消息

[英]Kendo File Upload with WebApi and IE8/9 Incorrect error message

I have a Web Api to upload a file using KendoUI and it works just fine across all browsers. 我有一个Web Api使用KendoUI上传文件,并且在所有浏览器中都可以正常工作。

However, whenever I tried to validate and generate an exception in IE 8/9 I get this message: 但是,每当我尝试在IE 8/9中验证并生成异常时,都会收到此消息:

' Server response: Error trying to get server response: Error: Access is denied.'

While in other browsers like Chrome or Firefox I get the right message. 在其他浏览器(例如Chrome或Firefox)中,我会收到正确的消息。

For example: 例如:

Request.CreateResponse(HttpStatusCode.InternalServerError, "The file is empty")

Chrome displays: "The file is empty" and IE 8/9 displays: "Access denied". Chrome显示:“文件为空”,而IE 8/9显示:“访问被拒绝”。

Any ideas? 有任何想法吗?

After hours of debugging and searching I found the answer to my own question: 经过数小时的调试和搜索,我找到了自己的问题的答案:

The answer is here “Access is denied” error on accessing iframe document object 答案是在访问iframe文档对象时出现“访问被拒绝”错误

[...] "So it turns out, that if a response is sent with an error code, IE replaces the content of the iframe with an error message loaded from the disk (res://ieframe.dll/http_500.htm), and that causes the cross-domain access denied error. by Ovesh" [...]“事实证明,如果发送的响应带有错误代码,则IE会用从磁盘加载的错误消息(res://ieframe.dll/http_500.htm)替换iframe的内容。 ,并导致跨域访问被拒绝错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM