...","url":"https://sir.kr/boards/program/18862","author":{"@type":"Person","name":"senseme","url":"https://sir.kr/profile/fd8d8956-5b99-4cbc-9e08-367f8488486f"},"interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":3}],"datePublished":"2013-03-28T19:24:58+09:00","dateModified":"2013-04-05T10:15:37+09:00","comment":[{"@type":"Comment","text":"잘봤어요~","author":{"@type":"Person","name":"쉽다zzz"},"datePublished":"2013-04-04T09:40:53+09:00"},{"@type":"Comment","text":"네~~","author":{"@type":"Person","name":"senseme"},"datePublished":"2013-04-05T01:38:57+09:00"},{"@type":"Comment","text":"깨알 지식 감사합니다 ㅎㅎ","author":{"@type":"Person","name":"강턱"},"datePublished":"2013-04-05T10:15:37+09:00"}]}
s

첨부파일 확장자 체크 [정규식]

파일 첨부 시 첨부파일 확장자가 이미지 파일인지 체크 하는 스크립트 입니다.

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
<title>확장자 검사</title>
<script language=javascript>

function checkExt()
{
var IMG_FORMAT = "\.(bmp|gif|jpg|jpeg|png)$"; //문서만 첨부하게 하려면 이 부분 바꿔주시면 되겠죠? ^^

if((new RegExp(IMG_FORMAT, "i")).test(document.form1.text1.value)) return true;

alert("이미지 파일만 첨부하실 수 있습니다. ");

return false;
}

</script>
</head>
<body>
<form name="form1" method="post" onsubmit="return checkExt()" encType="multipart/form-data">
<input type="file" name="text1">
<input type="submit">
</form>
</body>
</html>

|

댓글 3개

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

프로그램

+
제목 글쓴이 날짜 조회
12년 전 조회 2,791
12년 전 조회 7,898
12년 전 조회 2,425
12년 전 조회 2,418
12년 전 조회 2,473
12년 전 조회 2,087
12년 전 조회 4,329
12년 전 조회 2,874
12년 전 조회 2,902
12년 전 조회 2,431
12년 전 조회 4,088
12년 전 조회 3,095
12년 전 조회 1,862
12년 전 조회 4,957
12년 전 조회 2,435
12년 전 조회 2,213
12년 전 조회 2,619
12년 전 조회 6,954
12년 전 조회 2,587
12년 전 조회 4,191
12년 전 조회 3,652
12년 전 조회 1,894
12년 전 조회 4,342
12년 전 조회 2,811
12년 전 조회 2,734
12년 전 조회 2,781
12년 전 조회 4,687
12년 전 조회 3,490
12년 전 조회 5,117
12년 전 조회 9,984
12년 전 조회 5,581
12년 전 조회 5,172
12년 전 조회 2,752
12년 전 조회 2,838
12년 전 조회 4,581
12년 전 조회 5,408
12년 전 조회 5,810
12년 전 조회 3,016
12년 전 조회 2,723
12년 전 조회 2,350
12년 전 조회 2,380
12년 전 조회 4,150
12년 전 조회 4,157
12년 전 조회 2,692
12년 전 조회 4,249
12년 전 조회 2,693
12년 전 조회 9,757
12년 전 조회 2,993
12년 전 조회 5,188
12년 전 조회 7,808
12년 전 조회 2,987
12년 전 조회 4,281
12년 전 조회 2,006
12년 전 조회 2,676
12년 전 조회 2,543
12년 전 조회 2,716
12년 전 조회 4,722
12년 전 조회 2,519
12년 전 조회 3,234
12년 전 조회 2,660
12년 전 조회 2,337
12년 전 조회 2,790
12년 전 조회 3,520
12년 전 조회 2,744
12년 전 조회 2,550
12년 전 조회 3,105
12년 전 조회 1.6만
12년 전 조회 2,374
12년 전 조회 2,178
12년 전 조회 3,982
12년 전 조회 1만
12년 전 조회 2,553
12년 전 조회 2,494
12년 전 조회 2,934
12년 전 조회 2,392
12년 전 조회 2,568
12년 전 조회 4,826
12년 전 조회 2,773
12년 전 조회 3,434
12년 전 조회 2,430
12년 전 조회 2,604
13년 전 조회 4,325
13년 전 조회 2,168
13년 전 조회 2,658
13년 전 조회 2,969
13년 전 조회 3,407
13년 전 조회 3,527
13년 전 조회 3,971
13년 전 조회 2,434
13년 전 조회 2,446
13년 전 조회 5,827
13년 전 조회 2,882
13년 전 조회 3,056
13년 전 조회 6,928
13년 전 조회 4,629
13년 전 조회 3,545
13년 전 조회 2,729
13년 전 조회 4,910
13년 전 조회 3,904
13년 전 조회 3,587