链接有问题的话那flashget也就下载不了了,可是用flashget没问题,用ie自带的下载功能就不行(奇怪的是有两个可以,另外3个不行).
解决方案 »
- Winform ListBox DrawItem
- 求导入导出代码。
- 大家好,我问个asp:FileUpload的文件路径
- 关于用JavaScript改变元素的样式
- 我们打算用.NET2008开发,想找一个源代码管理程序,不知各位现在用的是谁家的,版本是什么?
- 连接mysql数据库 读数据时只能读取前5条,请问有人知道原因吗
- 请问(.NET检测到Web服务器运行的不是ASP.1.1版,您将无法运行WEB应用或服务)
- 有人能帮我看看这段语句有什么错误吗?
- 请教一个问题:我使用WebBrowser对象的方法,提示“没有权限”
- 请问如何从数据库中选出某段时间内的帖子!
- 怎样防止用户未登录就访问到某些页面?
- 在线等待,下载问题。
public void Download(string location)
{
//string location= @"c:\Inetpub\wwwroot\AppKJXM\canup\countrytjbb\tjbbs54.dbf";
// Response.Redirect(@"WebPublic\Modules\FileManager\Download.aspx?File=" + location);
System.IO.FileInfo file = new System.IO.FileInfo(location); // clear the current output content from the buffer
Response.Clear();
// add the header that specifies the default filename for the Download/SaveAs dialog
Response.AddHeader("Content-Disposition", "attachment; filename=" + file.Name);
// add the header that specifies the file size, so that the browser
// can show the download progress
Response.AddHeader("Content-Length", file.Length.ToString());
// specify that the response is a stream that cannot be read by the
// client and must be downloaded
Response.ContentType = "application/octet-stream";
// send the file stream to the client
Response.WriteFile(file.FullName);
// stop the execution of this page
Response.End();
}
简单的例子:
string st="love me.mp3";
Response.Write("<a href="+st+">love me.mp3</a>");
这样浏览器只能找到love?当然不能下载了,如果改为loveme.mp3问题就没有了,解决方法
Response.Write("<a href="+"'"+st+"'"+">love me.mp3</a>");
这样a指的就是整个文件名了,我想你的问题大概就是这种类型的^_^
我是新手,QQ:298311970
有兴趣的加我