我想实现一个文件下载的功能,请提供一个完整的源代码给我(汉字标题的文件也必须可以下载),最好可以告知是什么地方的设置使汉字标题的文件可以下载.
谢谢大虾们了!
即时关注,调试成功了就给分!
谢谢大虾们了!
即时关注,调试成功了就给分!
解决方案 »
- asp.net中MVC2.0里面Controller与View交互问题
- vs出现大量.tmp文件
- |zyciis| 200分赤: 通宵也搞不了的XML问题 我的WebForm XML.aspx生成一个XML文件,供我的WinForm程序读 但总提示:给定的编码有无效的字符
- 页面跳转问题,7456
- 关于多个imageButton调用calendar控件的问题,请高手帮忙!
- 上传时如何把文件上传到其他机器?
- 如何在水晶报表上画斜线,50分"倾家荡产"求助!
- asp.net ajax关于动态加载用户控件非常棘手的超难问题,内有示例链接.高手指教了~~~
- 请教各位大虾:.DLL文件怎么反编译成源代码
- 使用主题 css 文件要求页上有标头控件问题
- 我的.net工程怎么打不开呢,帮看看是什么原因啊
- 简单数据库更新请教。
Wc.DownloadFile("http://aspx/我.txt", "c:\我.text")
{
string path = Server.MapPath(Request.Params["File"]);
System.IO.FileInfo file = new System.IO.FileInfo(path);
Response.Clear();
Response.AddHeader("Content-Disposition", "attachment; filename=" + file.Name);
Response.AddHeader("Content-Length", file.Length.ToString());
Response.ContentType = "application/octet-stream";
Response.WriteFile(file.FullName);
Response.End(); }Web.config :
<globalization
requestEncoding="utf-8"
responseEncoding="utf-8"
/>
{
string path = Server.MapPath(Request.Params["File"]);
System.IO.FileInfo file = new System.IO.FileInfo(path); Response.Clear();
Response.AddHeader("Content-Disposition", "attachment; filename=" + Server.UrlEncode(file.Name));
Response.AddHeader("Content-Length", file.Length.ToString());
Response.ContentType = "application/octet-stream";
Response.WriteFile(file.FullName);
Response.End();
}
简单的asp.net(C#)下载系统