Posted in Javascript onDecember 11, 2010
function ReportFileStatus(filespec) { var fso, s = filespec; fso = new ActiveXObject("Scripting.FileSystemObject"); if (fso.FileExists(filespec)) s += " exists."; else s += " doesn't exist."; return(s); }
采用客户端的 FileSystemObject 对象
例:
function check() { var fso; fso = new ActiveXObject("Scripting.FileSystemObject"); if( fso.FileExists("c:\\testfile.txt")) { alert("Exists!"); } else { alert("not Exists!"); } }
JavaScript下利用fso判断文件是否存在的代码
声明:登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述。
Reply on: @reply_date@
@reply_contents@