 |
|
|  |
|
 |
16년 전 |
<html>
<head>
<script language="javascript" type="text/javascript">
<!--
extArray = new Array(".gif", ".jpg", ".png"); //첨부가능한 확장자 목록
function LimitAttach(form, file) {
allowSubmit = false;
if (!file) return;
while (file.indexOf("\\") != -1)
file = file.slice(file.indexOf("\\") + 1);
ext = file.slice(file.indexOf(".")).toLowerCase();
for (var i = 0; i < extArray.length; i++) {
if (extArray[i] == ext) { allowSubmit = true; break; }
}
if (allowSubmit) form.submit();
else
alert("업로드 가능한 확장자는 " + (extArray.join(" ")) + "입니다.");
}
//-->
</script>
</head>
<body>
업로드 가능한 확장자는 <B><script>document.write(extArray.join(" "));</script></B> 입니다.
<p>
<form method=post name=upform action="#" enctype="multipart/form-data">
<input type=file name=uploadfile><input type=button name="Submit" value="Submit" onclick="LimitAttach(this.form, this.form.uploadfile.value)">
</form>
</body>
</html> |
|
추천 : 427 |
추천
목록
|
|
|  |
|