js 判断本地文件


var fso, s=filespec; // filespec="C:/path/myfile.txt"
fso=new ActiveXObject("Scripting.FileSystemObject"); if(fso.FileExists(filespec)) 
    s+=" 文件存在."; 
else 
    s+=" 文件不存在.";

alert(s);

你可能感兴趣的:(js)