IIS中发布网站可以下载根目录外面的文件吗? 因为文件很大,而且在别的盘上,没有办法拷贝到发布的网站根目录下面,不知道有没有办法访问根目录外面目录中的文件,或者有没有什么替代办法。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 建个二级域名 file.xx.com 目录指向文件盘file.xx.com/filename.rar 这样下载?========================NET下载输出好像是绝对路径啊 不能下载吗?FileInfo fi = new FileInfo(destFileName); HttpContext.Current.Response.Clear(); HttpContext.Current.Response.ClearHeaders(); HttpContext.Current.Response.Buffer = false; if (filename == String.Empty) HttpContext.Current.Response.AppendHeader("Content-Disposition", "attachment;filename=" + Path.GetFileName(destFileName)); else HttpContext.Current.Response.AppendHeader("Content-Disposition", "attachment;filename=" + filename + UtilsFile.GetFileType(destFileName)); HttpContext.Current.Response.AppendHeader("Content-Length", fi.Length.ToString()); HttpContext.Current.Response.ContentType = "application/octet-stream"; HttpContext.Current.Response.WriteFile(fi.FullName); HttpContext.Current.Response.Flush(); HttpContext.Current.Response.End(); 可以的,有2个办法,一个是添加虚拟目录,另一个是直接将另一个分区挂接在某个目录下(ntfs分区才支持)。 .NET环境下SVN进行CheckOut时出现Could not open the requested SVN filesystem,急死人了啊! GridView分页 请问如何显示自定义变量? 用Asp.Net开发了一年,莫非是这句代码出错``????? ◆◇◆ 关于服务器性能监的问题! ◆◇◆ 用过eWebEditor的请进!!1 哪位有ASP.NET(C#)做的相册程序啊?本人有意购买~ 帮我看下,为什么不显示数据.代码有问题么。 JavaScript提示窗没有弹出的问题 大家谁知道用sharepoint做的网站 ajax 多次使用 给控件的Text赋值 出现了错误
file.xx.com/filename.rar 这样下载?
========================
NET下载输出好像是绝对路径啊 不能下载吗?FileInfo fi = new FileInfo(destFileName);
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.ClearHeaders();
HttpContext.Current.Response.Buffer = false; if (filename == String.Empty)
HttpContext.Current.Response.AppendHeader("Content-Disposition",
"attachment;filename=" + Path.GetFileName(destFileName));
else
HttpContext.Current.Response.AppendHeader("Content-Disposition",
"attachment;filename=" + filename + UtilsFile.GetFileType(destFileName)); HttpContext.Current.Response.AppendHeader("Content-Length", fi.Length.ToString());
HttpContext.Current.Response.ContentType = "application/octet-stream";
HttpContext.Current.Response.WriteFile(fi.FullName);
HttpContext.Current.Response.Flush();
HttpContext.Current.Response.End();