判断客户端文件时,可以用
(fso.FileExists(filespec))
s+=" exists.";
else
s
+=" doesn't exist.";
alert(s);


判断服务器端(网络文件)时,可以用

javascript判断文件是否存在var xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
javascript判断文件是否存在xmlhttp.open(
"GET",yourFileURL,false);
javascript判断文件是否存在xmlhttp.send();

 

可以<input style="width:100%" type="file" name="" >把contentEditable设置成false限制用户只能选择文件,而不能随便输入.

相关文章:

  • 2021-11-19
  • 2022-01-04
  • 2021-12-22
  • 2021-10-02
  • 2021-10-01
猜你喜欢
  • 2022-02-27
  • 2022-12-23
  • 2022-01-17
  • 2021-11-18
  • 2022-02-26
相关资源
相似解决方案