Share the method of javascript to determine whether a file exists.
1. When judging client files, you can use it
var fso,s=filespec; // filespec="C:/path/myfile.txt"fso=new ActiveXObject("Scripting.FileSystemObject");if(fso.FileExists(filespec))s+=" exists.";else // www.VeVB.COMs+=" doesn't exist.";alert(s);2. When judging the server side (network file), you can use it
var xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");xmlhttp.open("GET",yourFileURL,false);xmlhttp.send();if(xmlhttp.readyState==4){if(xmlhttp.status==200)s+=" exists."; //url exists else if(xmlhttp.status==404)s+=" doesn't exist."; //url does not exist else s+="";//Other status} // www.yuju100.comalert(s);You can set contentEditable to false to set contentEditable to false to limit users to select files, and cannot enter them at will.