1

正在开发的 MVC 应用程序具有上传/下载文件的功能,这些文件支持 xls、xlsm、xlsx、doc、docx、pdf、msg 等类型的文件。

最近,下载文件的代码被修改为返回 FileResult 表单操作方法,而不是提供指向服务器中文件的链接。鉴于以下代码:

public async Task<ActionResult> ShowFile()
{
   return new FileContentResult(FileBytes, mimeType);
}

windows7机器中的上述代码抛出Microsoft Excel安全警告弹出窗口并显示以下消息,但该代码在windows 10 IE 11中运行良好

The application experienced an internal error loading the SSL libraries

当代码修改如下,得到警告信息停止显示。

return this.File(response.FileBytes, mimeType, response.FileName);

有人可以帮助了解将 FileContentResult 作为 Action Result 的响应返回的真正原因吗

4

0 回答 0