首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

jQuery FileTree 怎么读取服务器目录

2012-09-05 
jQuery FileTree 如何读取服务器目录root: UploadFile/,script: jqueryFileTree.aspx,root是读取本地

jQuery FileTree 如何读取服务器目录
root: 'UploadFile/',
 script: 'jqueryFileTree.aspx',

root是读取本地计算机目录,那怎么读取服务器目录呢?

本人新手,请指教。

[解决办法]
通过ajax get 传值到ashx,aspx等获取服务器目录
通过json 等实现数据传递
点击节点,在下载页面
string fileName = "";//客户端保存的文件名
string filePath = Server.MapPath("");//路径

FileInfo fileInfo = new FileInfo(filePath);
Response.Clear();
Response.ClearContent();
Response.ClearHeaders();
Response.AddHeader("Content-Disposition", "attachment;filename=" + fileName);
Response.AddHeader("Content-Length", fileInfo.Length.ToString());
Response.AddHeader("Content-Transfer-Encoding", "binary");
Response.ContentType = "application/octet-stream";
Response.ContentEncoding = System.Text.Encoding.GetEncoding("gb2312");
Response.WriteFile(fileInfo.FullName);
Response.Flush();
Response.End();

热点排行