swf오픈소스을 이용한 업로드 간단설명~(확장자 구분)

· 15년 전 · 3728
엑티브 을 이용하여 업로드에서 일본쪽에서 엑티브 사용안한다고

swf오픈 소스을 이용하여 업로드구현

단 zip 파일만 업로드



기본적인것만 작성했음~



1. 오픈swf업로드 이용

2. zip 파일만 허용





http://swfupload.org/ <= swf업로드 다운받는 사이트 ~







css : swfupload 의 css부분

images : swfupload 의 버튼이미지

js : fileprogress.js : 진행바및 상태창 관련

handlers.js : 화면에 출력되거나 파일이 아니거나 하는 alert 창 메세지을 제어하는 스크립트

swfupload : 이 부분은 손을 만지지 않았다



===================

mediaupload.jsp



<html>
<head>
<title>:: test ::</title>

<!-- 업로드 스크립트 경로지정-->
<link href="./css/default.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<%=strCommonPath%>/media/swfupload/swfupload.js"></script>
<script type="text/javascript" src="<%=strCommonPath%>/media/swfupload/swfupload.queue.js"></script>
<script type="text/javascript" src="<%=strCommonPath%>/media/js/fileprogress.js"></script> <!-- 진행바및 상태창 관련 -->
<script type="text/javascript" src="<%=strCommonPath%>/media/js/handlers.js"></script> <!-- 이벤트 관련 -->
<script type="text/javascript">

var swfu;

window.onload = function() {
var settings = {

flash_url : "/mydocuhut/common/media/swfupload/swfupload.swf",
flash9_url : "/mydocuhut/common/media/swfupload/swfupload_fp9.swf",
upload_url: "jp/mediaup", //해당액션부분지정 <= 난 jp/mediaup 이란 서블릿명을 지정
//post_params: {"param0" : "teos"}, //파일 이외의 파라미터를 보낼때

//이부분은 기본적으로 바뀌지 않는 고정값등을 이부분에서 넣어줄수 있다.
post_params: {"upkind" : document.upFrm.upkind.value
, "idxnum" : "3"

},
file_size_limit : "5120 MB",
file_types : "*.zip", //이부분에 업로드할 확장자을 지정할 수 있다.
file_types_description : "All Files",
//file_types : "*.jpg;*.gif;*.png;*.jpeg",
//file_types_description : "jpg, gif, png, jpeg",//"All Files",
file_upload_limit :1, //최대 첨부 파일 수
file_queue_limit : 0,
custom_settings : {
progressTarget : "fsUploadProgress", //body부분에서 뿌려질 id명이다.
cancelButtonId : "btnCancel"
},
debug: false, //true일경우 debug창이 열린다.

// 버튼 셋팅
button_width: "80",
button_height: "22",
button_placeholder_id: "spanButtonPlaceHolder", //플레쉬로 교체될 DOM 엘리먼트
button_image_url: "/mydocuhut/common/media/images/searchbutton.gif", //플레쉬로 보여줄 버튼 이미지

//button_text: '<span class="theFont">파일찾기..</span>',
//button_text_style: ".theFont { background-color:red; font-size:13px; }",
//button_text_left_padding: 12,
//button_text_top_padding: 3,

button_action : SWFUpload.BUTTON_ACTION.SELECT_FILES,
button_disabled : false,
button_cursor : SWFUpload.CURSOR.HAND,
button_window_mode : SWFUpload.WINDOW_MODE.TRANSPARENT


// The event handler functions are defined in handlers.js

,swfupload_preload_handler : preLoad
,swfupload_load_failed_handler : loadFailed

,file_queued_handler : fileQueued //파일을 선택후 목록에 올린다.
,file_queue_error_handler : fileQueueError
,file_dialog_complete_handler : fileDialogComplete //전송 시작

,upload_start_handler : uploadStart //upload 시작?을때
,upload_progress_handler : uploadProgress
,upload_error_handler : uploadError
,upload_success_handler : uploadSuccess
,upload_complete_handler : uploadComplete
,queue_complete_handler : queueComplete // Queue plugin event

};

swfu = new SWFUpload(settings);

};

// 업로드 시작
function fileDialogComplete_mn() {
try {
/*

업로드 전에 이벤트는 이부분에 입력

널값 체크 등등

*/

//추가 파라미터나 업로드시 넘길 파라미터을 지정
swfu.addPostParam("media_title",document.upFrm.media_title.value);
swfu.startUpload(); //업로드
} catch (ex) {
swfu.debug(ex);
}
}
</script>
<!-- 업로드 스크립트 끝 -->

<body>



<form name="upFrm" action="jp/mediaup" method="post" encType="multipart/form-data">
<table width="100%" border="0" cellspacing="0" cellpadding="0">

<tr>
<td height="25" align="center" bgcolor="#E8E8E8" class="gray"><strong>제목
<font color="red"><sup>*</sup></font>
</strong></td>
<td> </td>
<td><input size="40" type="text" name="media_title" style="border : 1 solid #6b6b6b; width:270px; height:20px"></td>
</tr>

<tr>

<div id="divStatus"> - 0 Files Uploaded <!-- handlers.js 에서 컨트롤 한다. --></div>
<div class="fieldset flash" id="fsUploadProgress">
<span class="legend">업로드파일</span>
</div> //업로드 파일명 및 flash바 상태을 화면에 출력하는 부분

<span id="spanButtonPlaceHolder"></span> //찾아보기 버튼불러오기



<td height="20" align="center" background="<%=strLangPath%>/img1/bg3.gif" align="center" valign="center" colspan="3">
<input id="btnSubmit" type="button" value="업로드" onclick="fileDialogComplete_mn();" style="margin-center: 2px; font-size: 8pt; height: 20px;" />
<input id="btnCancel" type="button" value="닫기" onclick="javascript:self.close()" style="margin-center: 2px; font-size: 8pt; height: 20px;" />
</td>

</tr>

</table>

</form>

</body>

</html><div class='small'>[이 게시물은 관리자님에 의해 2011-10-31 17:16:08 PHP & HTML에서 이동 됨]</div>
|
댓글을 작성하시려면 로그인이 필요합니다.

프로그램

태그 필터 (최대 3개) 전체 개발자 소스 기타 mysql 팁자료실 javascript php linux flash 정규표현식 jquery node.js mobile 웹서버 os 프로그램 강좌 썸네일 이미지관련 도로명주소 그누보드5 기획자 견적서 계약서 기획서 마케팅 제안서 seo 통계 서식 통계자료 퍼블리셔 html css 반응형 웹접근성 퍼블리싱 표준화 반응형웹 홈페이지기초 부트스트랩 angularjs 포럼 스크린리더 센스리더 개발자톡 개발자팁 퍼블리셔톡 퍼블리셔팁 기획자톡 기획자팁 프로그램강좌 퍼블리싱강좌
+
제목 글쓴이 날짜 조회
15년 전 조회 862
15년 전 조회 1,019
15년 전 조회 878
15년 전 조회 1,105
15년 전 조회 645
15년 전 조회 1,033
15년 전 조회 1,040
15년 전 조회 979
15년 전 조회 915
15년 전 조회 1,250
15년 전 조회 970
15년 전 조회 914
15년 전 조회 945
15년 전 조회 884
15년 전 조회 896
15년 전 조회 968
15년 전 조회 1,357
15년 전 조회 738
15년 전 조회 805
15년 전 조회 974
15년 전 조회 977
15년 전 조회 831
15년 전 조회 1,414
15년 전 조회 931
15년 전 조회 1,155
15년 전 조회 1,549
15년 전 조회 1,035
15년 전 조회 1,052
15년 전 조회 955
15년 전 조회 905
15년 전 조회 1,246
15년 전 조회 998
15년 전 조회 870
15년 전 조회 1,262
15년 전 조회 2,416
15년 전 조회 993
15년 전 조회 1,123
15년 전 조회 1,250
15년 전 조회 965
15년 전 조회 1,022
15년 전 조회 1,065
15년 전 조회 940
15년 전 조회 1,035
15년 전 조회 2,518
15년 전 조회 1,831
15년 전 조회 6,119
15년 전 조회 1,362
15년 전 조회 1,644
15년 전 조회 2,007
15년 전 조회 3,729
15년 전 조회 3,055
15년 전 조회 2,129
15년 전 조회 1,648
15년 전 조회 4,094
15년 전 조회 1,169
15년 전 조회 947
15년 전 조회 1,123
15년 전 조회 1,055
15년 전 조회 1,043
15년 전 조회 1,030
15년 전 조회 989
15년 전 조회 1,118
15년 전 조회 922
15년 전 조회 909
15년 전 조회 786
15년 전 조회 4,545
15년 전 조회 1,025
15년 전 조회 730
15년 전 조회 1,142
15년 전 조회 1,118
15년 전 조회 1,240
15년 전 조회 908
15년 전 조회 1,039
15년 전 조회 1,020
15년 전 조회 992
15년 전 조회 871
15년 전 조회 929
15년 전 조회 1,055
15년 전 조회 857
15년 전 조회 860
15년 전 조회 908
15년 전 조회 869
15년 전 조회 843
15년 전 조회 859
15년 전 조회 856
15년 전 조회 869
15년 전 조회 827
15년 전 조회 831
15년 전 조회 804
15년 전 조회 1,014
15년 전 조회 963
15년 전 조회 817
15년 전 조회 834
15년 전 조회 767
15년 전 조회 1,947
15년 전 조회 984
15년 전 조회 789
15년 전 조회 927
15년 전 조회 829
15년 전 조회 966