我的下载功能不能下载大文件
问题是这样的:我的下载功能如果在vs上直接浏览的话是没有问题,但是我用IIS发布以后 ,如果文件大了就不能下载了,我试了试200M以上的就不能了,也不报错,就是一直在加载网页。我怀疑是iss哪的问题可是不知道怎样解决,希望高手们的帮助?我的下载方法是这样的:private void FileDownload(string file)
{
string fileName = file.Substring(file.LastIndexOf('/')+1);
string filePath = Server.MapPath(file);//繚噤
FileInfo fileInfo = new FileInfo(filePath);
Response.Clear();
Response.ClearContent();
Response.ClearHeaders();
Response.AddHeader("Content-Disposition", "attachment;filename=" + fileName);
//Response.AddHeader("Content-Disposition", "attachment;");
Response.AddHeader("Content-Length", fileInfo.Length.ToString());
Response.AddHeader("Content-Transfer-Encoding", "binary");
Response.ContentType = "application/octet-stream";
Response.ContentEncoding = System.Text.Encoding.GetEncoding("gb2312");
Response.WriteFile(fileInfo.FullName);
Response.Flush();
Response.End();
(DownloadFile.FullName);
Response.Flush();
Response.End();
}
web.config我是这样设置的<httpRuntime maxRequestLength="2097151" executionTimeout="120" />