0

我正在使用以下代码将 PDF 发送给用户以打开/下载。这在 IE9 中运行良好。任何想法为什么它不能在 Chrome 中工作?

Response.Clear();

Response.AddHeader("Content-Disposition", "attachment; filename= \"" + myFile + "\"");
Response.AddHeader("Content-Length", myFile.Length.ToString());

Response.WriteFile(myFile.FullName);

Response.Flush();
Response.End();
4

1 回答 1

0

添加这个:

Response.ContentType = "application/pdf";
于 2011-10-18T23:23:34.360 回答