특정 파일형태만 업로드 할 수 있습니다 정보
기타 특정 파일형태만 업로드 할 수 있습니다본문
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> Sample Script </TITLE>
<META NAME="Author" CONTENT="JASKO">
<SCRIPT LANGUAGE="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(" ")) + "n다시 선택 해 주세요");
}
//-->
</script>
</HEAD>
<BODY>
<center>
아래 파일들만 업로드 할 수 있습니다
<script>
document.write(extArray.join(" "));
</script>
<p>
<form method=post name=upform action="../../result,html" enctype="multipart/form-data">
<input type=file name=uploadfile>
<p>
<input type=button name="Submit" value=" 전송 " onclick="LimitAttach(this.form, this.form.uploadfile.value)">
</form>
</center>
</BODY>
</HTML><div class='small'>[이 게시물은 관리자님에 의해 2011-10-31 17:16:08 PHP & HTML에서 이동 됨]</div>
<HTML>
<HEAD>
<TITLE> Sample Script </TITLE>
<META NAME="Author" CONTENT="JASKO">
<SCRIPT LANGUAGE="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(" ")) + "n다시 선택 해 주세요");
}
//-->
</script>
</HEAD>
<BODY>
<center>
아래 파일들만 업로드 할 수 있습니다
<script>
document.write(extArray.join(" "));
</script>
<p>
<form method=post name=upform action="../../result,html" enctype="multipart/form-data">
<input type=file name=uploadfile>
<p>
<input type=button name="Submit" value=" 전송 " onclick="LimitAttach(this.form, this.form.uploadfile.value)">
</form>
</center>
</BODY>
</HTML><div class='small'>[이 게시물은 관리자님에 의해 2011-10-31 17:16:08 PHP & HTML에서 이동 됨]</div>
추천
0
0
댓글 0개