2012-03-09 33 views
0

我們有一個下載頁面,用戶可以下載PDF文檔。此頁面當前用作HTTPS。在Safari 只有(包括Windows和Mac)下載大約3/4下載(一旦在藍色的月亮它將工作)後,下載將失敗99%的時間。如果我們用「http」替換URL的「https」部分,問題會立即消失。SSL下的Response.TransmitFile在Safari上失敗

的代碼如下,相信標準.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,Firefox和Chrome每次都能正確下載文件。 Safari失敗9/10次。

任何想法?我們每個月在Safari上有大約4,000位訪問者訪問該網站,因此這不是我們可以忽略的。

回答

0

你總是可以嘗試使用response.writefile(認爲這會首先裝載到服務器的內存中,如同傳輸文件一樣)以查看是否有幫助。