我们有一个下载页面,用户可以下载PDF文档。此页面当前用作HTTPS。在Safari 下,只有(包括和Mac)在下载大约3/4之后,下载就会失败99% (一旦下载成功)。如果我们将URL的"https“部分替换为"http”,问题就会立即消失。
代码如下,我相信标准的.NET文件输出:
string pdfFile = // generate file here and get the path...
var info = new FileInfo(pdfFile);
Response.ClearContent();
Response.ClearHeaders();
Response.ContentType = "application/pdf";
Response.AppendHeader("Content-Disposition", string.Format("attachment;Filename={0}", info.Name);
Response.TransmitFile(pdfFile);
Response.Flush();
Response.Close();这个问题是只有在Safari;IE,火狐和Chrome每次正确下载文件。旅行失败了9/10次。
有什么想法吗?我们每个月在Safari网站上有大约4000名访问者,所以我们不能忽视这一点。
发布于 2012-03-09 15:10:16
您可以尝试response.writefile (首先将它加载到服务器上的内存中,作为传输文件的附件),看看它是否有帮助。
https://stackoverflow.com/questions/9636183
复制相似问题