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

· 10년 전 · 188

<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년 전 조회 182
10년 전 조회 161
10년 전 조회 214
10년 전 조회 240
10년 전 조회 342
10년 전 조회 376
10년 전 조회 225
10년 전 조회 258
10년 전 조회 224
10년 전 조회 145
10년 전 조회 150
10년 전 조회 330
10년 전 조회 189
10년 전 조회 182
10년 전 조회 185
10년 전 조회 263
10년 전 조회 318
10년 전 조회 228
10년 전 조회 265
10년 전 조회 204
10년 전 조회 476
10년 전 조회 302
10년 전 조회 263
10년 전 조회 275
10년 전 조회 191
🐛 버그신고