업로드시 지정된 확장자만 첨부 가능합니다
페이지 정보
작성자 서방님 댓글 0건 조회 138회 작성일 07-08-11 16:38본문
<html>
<head>
<title>http://www.blueb.co.kr</title>
<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>
댓글목록
등록된 댓글이 없습니다.