在服务端下载文件提示与服务器的连接被重置。。。
我是新手,我写了一段代码是从服务端下载文件的,但这段代码在VS2005调试时是可以下载大于2G的文件,但挂到IIS6上就只能下载300M以下的文件,大于300M就提示“于服务器的连接被重置”,请各位大侠帮帮忙,万分感激!!!这是我写的代码:
Dim filename As String
filename = ()
Dim destFileName As String
destFileName = Server.MapPath("./") + filename
destFileName = Server.UrlDecode(destFileName)
If (File.Exists(destFileName)) Then
Dim fi As
fi = New FileInfo(destFileName)
Response.Clear()
Response.ClearHeaders()
Response.Buffer = True
Response.Charset = "GB2312"
' //添加头信息,为 "文件下载/另存为 "对话框指定默认文件名
Response.AppendHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(Path.GetFileName(destFileName), System.Text.Encoding.UTF8))
Response.AppendHeader("Content-Length", fi.Length.ToString())
Response.ContentType = "text/plain"
Response.Filter.Close()
Response.WriteFile(destFileName)
Response.Flush()
Response.End()
Else
Response.Write("<script language = javascript>alert('下载出错')</script>")
End If