クライアントファイルを審査するときは、使用できます
次のようにコードコードをコピーします。
var fso、s = filespec;
fso = new ActiveXObject( "Scripting.filesystemObject");
if.fileexists(fileSpec))
s+= "Existes。";
それ以外
s+= "存在しません。" ;;
アラート(s);
サーバー側(ネットワークファイル)を判断するときは、使用できます
次のようにコードコードをコピーします。
var xmlhttp = new ActiveXObject( "microsoft.xmlhttp");
xmlhttp.open( "get"、your、false);
xmlhttp.send();
if(xmlhttp.readystate == 4){{
if(xmlhttp.status == 200)s+= "存在します
elseの場合(xmlhttp.status == 404)s+= "存在しません。";
else s+= ""; //他の状態
}
アラート(s);
<入力型= "file" name = "id =" "contentedable =" false "> falseに設定して、ユーザーを入力ではなく選択のみに制限するように設定します。