文件名挺长,无法下载 我用c#做了一个页面,可以选择服务器上的文件打开或下载,但是如果文件长一点,就不成功,请问哪位知道是怎么回事? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 我的代码如下,请看一下哪里有问题 private void FileDownload(string FullFileName) { FileInfo DownloadFile = new FileInfo(FullFileName); Response.Clear(); Response.ClearHeaders(); Response.Buffer=false; Response.ContentType="application/octet-stream"; Response.AppendHeader("Content-Disposition","attachment;filename=" +HttpUtility.UrlEncode(DownloadFile.FullName,System.Text.Encoding.UTF8)); Response.AppendHeader("Content-Length",DownloadFile.Length.ToString()); Response.WriteFile(DownloadFile.FullName); Response.Flush(); Response.End(); } VS2008中没ACT,那用什么测试啊? 知道后立即给分 手动为C#程序设置ico图标 什么是简单工厂?什么是抽象工厂? 多窗体问题 html代码了与页面内容转换问题 急求 医院管理系统代码 文本文件读写中遇到的问题 请问在.NET中使用CrystalReportViewer这个控件会不会过期???我用的是CrystalReport9注册版制作的水晶报表文件 WPF对象方法使用不匹配 高分请教排序问题 如何解决dataGrid的标题栏显示的问题 怎样在EXE可执行文件中传入参数?
private void FileDownload(string FullFileName)
{
FileInfo DownloadFile = new FileInfo(FullFileName);
Response.Clear();
Response.ClearHeaders();
Response.Buffer=false;
Response.ContentType="application/octet-stream";
Response.AppendHeader("Content-Disposition","attachment;filename=" +HttpUtility.UrlEncode(DownloadFile.FullName,System.Text.Encoding.UTF8));
Response.AppendHeader("Content-Length",DownloadFile.Length.ToString());
Response.WriteFile(DownloadFile.FullName);
Response.Flush();
Response.End();
}