把指定文件输出到http流的问题 HttpUtility.UrlEncode(myFullName)) =========>HttpUtility.UrlEncode(System.Text.Encoding.UTF8.GetBytes(strFileName));试试 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 在web.config设置就行了<httpRuntime executionTimeout="900" maxRequestLength="2048000" useFullyQualifiedRedirectUrl="false" minFreeThreads="8" minLocalRequestFreeThreads="4" appRequestQueueLimit="100" enableVersionHeader="true"/> 修改maxRequestLength就可以了,上传一定可以,你去试试下载看行不 对于大文件的输出不要使用Response.WriteFile你的内存会被耗尽的if(File.Exists(filePath)){Response.ContentType = "application/octet-stream"; BinaryReader br = new BinaryReader(File.OpenRead(filePath));BinaryWriter bw = new BinaryWriter(Response.OutputStream);byte[] buffer = new byte[1024];int i = 1024;while(i == 1024){i = br.Read(buffer,0,i);bw.Write(buffer,0,i);}br.Close();bw.Close();return;} 请教高手asmx.cs问题 如此正则表达式如何写?匹配不在<span ...>...</span> 下面这事件的dg_jcxx_ItemCreated的意思! 简单的JS问题(如何用JS获得图片ALT属性中的内容) 关于DATATALBE的一个问题。 求救,ASP.net2.0问题 无法把DATASET绑定到LISTBOX C#中如何实现使用右键菜单 请问网上类似FreeTextBox这样的开源控件是不是只有这一个啊?还有没有别的? 高手指点迷津!急 如何刷新前一个页面? 在线咨询有关静态函数和参数的用法
<httpRuntime executionTimeout="900" maxRequestLength="2048000" useFullyQualifiedRedirectUrl="false" minFreeThreads="8" minLocalRequestFreeThreads="4" appRequestQueueLimit="100" enableVersionHeader="true"/> 修改maxRequestLength就可以了,上传一定可以,你去试试下载看行不
不要使用Response.WriteFile
你的内存会被耗尽的if(File.Exists(filePath))
{
Response.ContentType = "application/octet-stream";
BinaryReader br = new BinaryReader(File.OpenRead(filePath));
BinaryWriter bw = new BinaryWriter(Response.OutputStream);
byte[] buffer = new byte[1024];
int i = 1024;
while(i == 1024)
{
i = br.Read(buffer,0,i);
bw.Write(buffer,0,i);
}
br.Close();
bw.Close();
return;
}