使用 WebAPI 和 IE8/9 上传剑道文件不正确的错误消息

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

本文关键字:文件 不正确 消息 错误 WebAPI IE8 使用      更新时间:2023-09-26

我有一个Web Api可以使用KendoUI上传文件,它可以在所有浏览器上运行良好。

但是,每当我尝试在IE 8/9中验证并生成异常时,我都会收到以下消息:

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

而在Chrome或Firefox等其他浏览器中,我得到了正确的消息。

例如:

Request.CreateResponse(HttpStatusCode.InternalServerError, "The file is empty")
Chrome 显示:"

文件为空",IE 8/9 显示:"访问被拒绝"。

有什么想法吗?

经过数小时的调试和搜索,我找到了自己问题的答案:

答案在这里 访问 iframe 文档对象时出现"访问被拒绝"错误

[...]"事实证明,如果发送带有错误代码的响应,IE会将iframe的内容替换为从磁盘加载的错误消息(res://ieframe.dll/http_500.htm),这会导致跨域访问被拒绝错误。由奥维什"