특정 파일형태만 업로드 하기 입니다.

· 10년 전 · 185

<HTML>
<HEAD>
<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>

|
댓글을 작성하시려면 로그인이 필요합니다. 로그인

팁게시판

디자인과 관련된 유용한 정보를 공유하세요. 질문은 상단의 QA에서 해주시기 바랍니다.

+
제목 글쓴이 날짜 조회
10년 전 조회 180
10년 전 조회 157
10년 전 조회 211
10년 전 조회 237
10년 전 조회 338
10년 전 조회 373
10년 전 조회 222
10년 전 조회 255
10년 전 조회 219
10년 전 조회 141
10년 전 조회 146
10년 전 조회 326
10년 전 조회 186
10년 전 조회 178
10년 전 조회 182
10년 전 조회 259
10년 전 조회 314
10년 전 조회 224
10년 전 조회 261
10년 전 조회 200
10년 전 조회 472
10년 전 조회 299
10년 전 조회 260
10년 전 조회 271
10년 전 조회 187
🐛 버그신고