1
我試圖寫代碼來下載文件。我已經測試過本地服務器沒有錯誤, 但是生產服務器(iis在DMZ區域) 。 我收到如下錯誤。本地IIS(DMZ區域)中的錯誤[ERR_INVALID_RESPONSE]沒有錯誤
信息錯誤
(可能是暫時,或者它已永久性地移動到了新網址 錯誤代碼:ERR_INVALID_RESPONSE)
FileStream fs = null;
fs = File.Open(localPath, FileMode.Open);
byte[] btFile = new byte[fs.Length + 1];
fs.Read(btFile, 0, Convert.ToInt32(fs.Length));
fs.Close();
Response.AddHeader("Content-disposition", "attachment; filename=" + fileName);
Response.ContentType = "application/" + type;
Response.BinaryWrite(btFile);
Response.Flush();
Response.Close();
我應該怎麼做來解決它。 。?請告訴我
謝謝
「錯誤」代碼實際上是一個320的HTTP狀態代碼,它應該將您重定向到一個新的URL。您將需要查看響應的狀態代碼並查看它是否爲200(確定),然後嘗試寫出文件。合理? – techvice 2014-11-21 03:58:15