【发布时间】:2010-07-08 01:05:50
【问题描述】:
我只是尝试使用 ASP.net 处理程序将 .wav 文件发送到 Internet Explorer:
public void ProcessRequest(HttpContext context)
{
HttpResponse response = context.Response;
response.ContentType = "audio/x-wav";
response.WriteFile("MyWav.wav");
response.AddHeader("Content-Length", "304578");
response.Flush();
}
这适用于 Firefox 和 Chrome,但我只是在 Internet Explorer 中看到一个空白屏幕。为什么?
(我已尝试设置“Content-Disposition”标头。如果我将其设置为“附件”,我am会显示下载对话框。如果我将其设置为“内联”,我只是像以前一样得到一个空白页。
【问题讨论】:
-
“为什么?”我如此很想说,因为它是 IE,你期待什么?不过实话说。您可能应该提及您正在谈论的版本。
-
这是 Internet Explorer 8
-
那么 Content-Disposition:attachment 可以满足您的需求吗?那你有什么问题?
-
否 - 我需要 wav 文件内联播放。
-
不是——它只是对问题的精简解释——无法解决如何取消旧问题。