JavaScriptの方法を共有して、ファイルが存在するかどうかを判断します。
1.クライアントファイルを判断する場合、使用できます
var fso、s = fileSpec; // fileSpec = "c:/path/myfile.txt" fso = new ActiveXObject( "Scripting.filesystemSystemObject"); if(fso.fileexists(fileSpec))s+= "存在します。
2。サーバー側(ネットワークファイル)を判断するとき、それを使用できます
var xmlhttp = new ActiveXObject( "microsoft.xmlhttp"); xmlhttp.open( "get"、yourfileurl、false); xmlhttp.send(); if(xmlhttp.readystate == 4){if(xmlhttp.status == 200) // urlは存在します(xmlhttp.status == 404)s+= "存在しません。"; // urlは存在しませんs+= ""; //その他のステータス} // www.yuju100.comalert(s);Contentedableをfalseに設定して、ContentedableをFalseに設定して、ユーザーを選択してファイルを選択し、自由に入力できません。