업로드시 지정된 확장자만 첨부 가능합니다 > script

본문 바로가기
사이트 내 전체검색

script

업로드시 지정된 확장자만 첨부 가능합니다

페이지 정보

작성자 서방님 댓글 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>

댓글목록

등록된 댓글이 없습니다.

Total 846건 29 페이지
게시물 검색

회원로그인

접속자집계

오늘
61
어제
302
최대
1,347
전체
155,122
Latest Crypto Fear & Greed Index

그누보드5
Copyright © 서방님.kr All rights reserved.