<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-Type" content="text/html;charset=gb2312">
<title>網頁特效 上傳檔名是否包含中文</title>
</head>
<body>
<script language="javascript">
function check(o){
var str=o.value.split("\\")[o.value.split("\\").length-1];
var re=/[\u0391-\uFFE5]+/g
if (str.match(re)!=null) alert('檔名不能包含漢字!');

else alert('檔名合法!');

}else{

alert("上傳檔案不可包含中文!");

return false;

}

</script>

<input id="zzjs_fileupload" type="file">

<input type="button" onclick="check(document.getElementById('zzjs_fileupload'))" value="上傳">

</body>
</html>