浏览器将文件‘静默’下载到指定位置哪位大牛知道,通过浏览器 静默下载文件到客户端指定位置,就是不需要浏览器端用户任何操作,自动将服务器端文件更新到客户相应位置。求指点....... [解决办法]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" ><head> <title>HTTP文件下载控件演示页面</title> <link type="text/css" href="HttpDownloader/HttpDownloader.css" rel="Stylesheet"/> <script type="text/javascript" src="HttpDownloader/HttpDownloader.js" charset="utf-8"></script></head><body><input type="button" value="下载测试文件" onclick="StartDown()" /><div id="downDiv"></div> <script type="text/javascript" language="javascript"> var downerMgr = new FileDownloaderMgr(); downerMgr.Config["Folder"] = "F:\"; downerMgr.LoadTo("downDiv");window.onload = function(){downerMgr.Init();};function StartDown(){//添加到下载队列downerMgr.AddFile("http://www.ncmem.com/images/ico-ftp.jpg");downerMgr.PostFirst();}function copyFile(){var obj = new ActiveXObject(downerMgr.ActiveX["Partition"]);obj.CopyFile("f:\\ftp\\test.gif","f:\\ftp\\test1.gif");}function copyFolder(){var obj = new ActiveXObject(downerMgr.ActiveX["Partition"]);obj.CopyFile("f:\\ftp\\test.gif","f:\\ftp\\ftp1");}function moveFile(){var obj = new ActiveXObject(downerMgr.ActiveX["Partition"]);obj.MoveFile("f:\\ftp\\test.gif","f:\\ftp\\test2.gif");}function moveFolder(){var obj = new ActiveXObject(downerMgr.ActiveX["Partition"]);obj.MoveFile("f:\\ftp\\test2.gif","f:\\ftp\\ftp1");}</script><input type="button" value="复制到文件" onclick="copyFile()" /><input type="button" value="复制到文件夹" onclick="copyFolder()" /><input type="button" value="移动文件" onclick="moveFile()" /><input type="button" value="移动到文件夹" onclick="moveFolder()" /></body></html>
Xproer.HttpDownloader:http://www.cnblogs.com/xproer/archive/2011/03/26/1996322.html示例代码:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" ><head> <title>HTTP文件下载控件演示页面</title> <link type="text/css" href="HttpDownloader/HttpDownloader.css" rel="Stylesheet"/> <script type="text/javascript" src="HttpDownloader/HttpDownloader.js" charset="utf-8"></script></head><body><input type="button" value="下载测试文件" onclick="StartDown()" /><div id="downDiv"></div> <script type="text/javascript" language="javascript"> var downerMgr = new FileDownloaderMgr(); downerMgr.Config["Folder"] = "F:\"; downerMgr.LoadTo("downDiv");window.onload = function(){downerMgr.Init();};function StartDown(){//添加到下载队列downerMgr.AddFile("http://www.ncmem.com/images/ico-ftp.jpg");downerMgr.PostFirst();}function copyFile(){var obj = new ActiveXObject(downerMgr.ActiveX["Partition"]);obj.CopyFile("f:\\ftp\\test.gif","f:\\ftp\\test1.gif");}function copyFolder(){var obj = new ActiveXObject(downerMgr.ActiveX["Partition"]);obj.CopyFile("f:\\ftp\\test.gif","f:\\ftp\\ftp1");}function moveFile(){var obj = new ActiveXObject(downerMgr.ActiveX["Partition"]);obj.MoveFile("f:\\ftp\\test.gif","f:\\ftp\\test2.gif");}function moveFolder() {var obj = new ActiveXObject(downerMgr.ActiveX["Partition"]);obj.MoveFile("f:\\ftp\\test2.gif","f:\\ftp\\ftp1");}</script><input type="button" value="复制到文件" onclick="copyFile()" /><input type="button" value="复制到文件夹" onclick="copyFolder()" /><input type="button" value="移动文件" onclick="moveFile()" /><input type="button" value="移动到文件夹" onclick="moveFolder()" /></body></html>资源下载:CAB安装包开发文档DEMO示例
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" ><head> <title>HTTP文件下载控件演示页面</title> <link type="text/css" href="HttpDownloader/HttpDownloader.css" rel="Stylesheet"/> <script type="text/javascript" src="HttpDownloader/HttpDownloader.js" charset="utf-8"></script></head><body><input type="button" value="下载测试文件" onclick="StartDown()" /><div id="downDiv"></div> <script type="text/javascript" language="javascript"> var downerMgr = new FileDownloaderMgr(); downerMgr.Config["Folder"] = "F:\"; downerMgr.LoadTo("downDiv");window.onload = function(){downerMgr.Init();};function StartDown(){//添加到下载队列downerMgr.AddFile("http://www.ncmem.com/images/ico-ftp.jpg");downerMgr.PostFirst();}function copyFile(){var obj = new ActiveXObject(downerMgr.ActiveX["Partition"]);obj.CopyFile("f:\\ftp\\test.gif","f:\\ftp\\test1.gif");}function copyFolder(){var obj = new ActiveXObject(downerMgr.ActiveX["Partition"]);obj.CopyFile("f:\\ftp\\test.gif","f:\\ftp\\ftp1");}function moveFile(){var obj = new ActiveXObject(downerMgr.ActiveX["Partition"]);obj.MoveFile("f:\\ftp\\test.gif","f:\\ftp\\test2.gif");}function moveFolder() {var obj = new ActiveXObject(downerMgr.ActiveX["Partition"]);obj.MoveFile("f:\\ftp\\test2.gif","f:\\ftp\\ftp1");}</script><input type="button" value="复制到文件" onclick="copyFile()" /><input type="button" value="复制到文件夹" onclick="copyFolder()" /><input type="button" value="移动文件" onclick="moveFile()" /><input type="button" value="移动到文件夹" onclick="moveFolder()" /></body></html>
{var obj = new ActiveXObject(downerMgr.ActiveX["Partition"]);obj.MoveFile("f:\\ftp\\test2.gif","f:\\ftp\\ftp1");}</script><input type="button" value="复制到文件" onclick="copyFile()" /><input type="button" value="复制到文件夹" onclick="copyFolder()" /><input type="button" value="移动文件" onclick="moveFile()" /><input type="button" value="移动到文件夹" onclick="moveFolder()" /></body></html>