我的下载只是从本地文件系统中提供静态 zip 文件,该文件在 Chrome 和 Firefox 中有效,但在 IE8 中无效。
该网站使用 SSL 在 localhost 上运行,但我在 IE 中收到以下错误消息。
无法从 localhost 下载 Download/。
无法打开此 Internet 站点。请求的站点不可用或找不到。请稍后再试。
public ActionResult Download(long batchID)
{
var batchFilePath = string.Format(BatchOrderReportsFolder + "\\Batch-{0}\\Batch-{0}.zip", batchID);
if (!System.IO.File.Exists(batchFilePath)) {
return RedirectToAction("Index", "Error");
}
return File(batchFilePath, "application/zip", Path.GetFileName(batchFilePath));
}