| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
| <html xmlns="http://www.w3.org/1999/xhtml" lang="ko" xml:lang="ko"> | |
| <head> | |
| <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
| <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=yes, target-densitydpi=medium-dpi" /> | |
| <title> 공지사항</title> | |
| <link rel="stylesheet" href="/addons/resize_image/css/resize_image.mobile.css" type="text/css" charset="UTF-8" media="all" /> | |
| <link rel="stylesheet" href="/modules/board/m.skins/default/css/mboard.css" type="text/css" charset="UTF-8" media="all" /> | |
| <link rel="stylesheet" href="/modules/editor/styles/default/style.css" type="text/css" charset="UTF-8" media="all" /> | |
| <link rel="stylesheet" href="/addons/socialxe_helper/css/css.css" type="text/css" charset="UTF-8" media="all" /> | |
| <script type="text/javascript" src="/common/js/jquery.js?20120407195935"></script> | |
| <script type="text/javascript" src="/common/js/js_app.js?20120407195935"></script> | |
| <script type="text/javascript" src="/common/js/x.js?20120407195936"></script> | |
| <script type="text/javascript" src="/common/js/common.js?20120407195935"></script> | |
| <script type="text/javascript" src="/common/js/xml_handler.js?20120407195935"></script> | |
| <script type="text/javascript" src="/common/js/xml_js_filter.js?20120407195935"></script> | |
| <script type="text/javascript" src="/modules/board/m.skins/default/js/mboard.js?20120318115353"></script> | |
| <script type="text/javascript" src="/modules/board/m.skins/default/js/ajaxfileupload.js?20110727151648"></script> | |
| <link rel="shortcut icon" href="files/attach/xeicon/favicon.ico" /><link rel="apple-touch-icon" href="files/attach/xeicon/mobicon.png" /><!--[if lt IE 9]> | |
| <![endif]--> | |
| <script type="text/javascript">//<![CDATA[ | |
| var current_url = "http://jhrun.iptime.org/?mid=schoolnotice&m=1&act=dispBoardWrite"; | |
| var request_uri = "http://jhrun.iptime.org/"; | |
| var current_mid = "schoolnotice"; | |
| var waiting_message = "서버에 요청 중입니다. 잠시만 기다려주세요."; | |
| var ssl_actions = new Array(); | |
| var default_url = "http://jhrun.iptime.org/"; | |
| //]]></script> | |
| <link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://jhrun.iptime.org/main/api" /> | |
| <style type="text/css"> .xe_content img{padding:0;margin:0;} .xe_content img{padding:2px 0;} .xe_content .auto_insert {text-align:;} </style></head> | |
| <body> | |
| <script type="text/javascript" > | |
| function ajaxFileUpload() | |
| { | |
| if(document.getElementById('Filedata').value ==""){ | |
| alert("파일을 선택하세요"); | |
| return false; | |
| } | |
| jQuery("#loading") | |
| .ajaxStart(function(){ | |
| jQuery(this).show(); | |
| }) | |
| .ajaxComplete(function(){ | |
| jQuery(this).hide(); | |
| }); | |
| jQuery.ajaxFileUpload | |
| ( | |
| { | |
| url:'index.php?&act=procFileIframeUpload', | |
| secureuri:false, | |
| fileElementId:'Filedata', | |
| dataType: 'html', | |
| data:{ | |
| mid: 'schoolnotice', | |
| editor_sequence: '1', | |
| uploadTargetSrl: '', | |
| manual_insert: 'true' | |
| }, | |
| success: function (frameId, data, status) | |
| { | |
| var frm = document.getElementById('ff'); | |
| var io = document.getElementById(frameId); | |
| if(io.contentWindow) | |
| { | |
| var sourceFile = document.getElementById(frameId).contentWindow.uploaded_fileinfo.source_filename; | |
| var uploadFile = document.getElementById(frameId).contentWindow.uploaded_fileinfo.uploaded_filename; | |
| var document_srl = document.getElementById(frameId).contentWindow.uploaded_fileinfo.upload_target_srl; | |
| var file_srl = document.getElementById(frameId).contentWindow.uploaded_fileinfo.file_srl; | |
| }else if(io.contentDocument) | |
| { | |
| var sourceFile = document.getElementById(frameId).contentDocument.uploaded_fileinfo.source_filename; | |
| var uploadFile = document.getElementById(frameId).contentDocument.uploaded_fileinfo.uploaded_filename; | |
| var document_srl = document.getElementById(frameId).contentDocument.uploaded_fileinfo.upload_target_srl; | |
| var file_srl = document.getElementById(frameId).contentDocument.uploaded_fileinfo.file_srl; | |
| } | |
| frm.document_srl.value = document_srl; | |
| // document.getElementById('Filedata').value ='aaa'; | |
| if(uploadFile != ""){ | |
| jQuery('<li id="'+file_srl+'"></li>').appendTo('#files').html('<img src="/modules/board/m.skins/default/'+uploadFile+'" /><span class="filename">'+sourceFile+'</span><a href="javascript:delete_file('+file_srl+',1)" class="abn dark">삭제</a>').addClass('success'); | |
| } else{ | |
| jQuery('<li></li>').appendTo('#files').text(sourceFile).addClass('error'); | |
| } | |
| if(typeof(data.error) != 'undefined') | |
| { | |
| if(data.error != '') | |
| { | |
| alert(data.error); | |
| }else | |
| { | |
| alert(data.msg); | |
| } | |
| } | |
| }, | |
| error: function (data, status, e) | |
| { | |
| alert(e); | |
| } | |
| } | |
| ) | |
| return false; | |
| } | |
| function frmSubmit(){ | |
| var frm = document.getElementById('ff'); | |
| procFilter(frm, insert); | |
| } | |
| function delete_file(file_srl,editorSequence){ | |
| var msg = window.confirm('삭제하시겠습니까?'); | |
| if(msg) | |
| { | |
| var settings = file_srl; | |
| var params = new Array(); | |
| params["file_srls"] = file_srl; | |
| params["editor_sequence"] = editorSequence; | |
| var response_tags = new Array("error","message"); | |
| exec_xml("file","procFileDelete", params, function() { reloadFileList(settings); } ); | |
| }else{ | |
| return false; | |
| } | |
| } | |
| function reloadFileList(settings) { | |
| jQuery("#"+settings).remove(); | |
| } | |
| </script> | |
| <div class="clear"></div> | |
| <br/> | |
| <hr/> | |
| <div class="bd"> | |
| <div class="hx h2"> | |
| <h2><a href="/schoolnotice"> 공지사항</a></h2> | |
| </div> | |
| <div class="hx h3"> | |
| <h3>쓰기</h3> | |
| </div> | |
| <div class="fix"> | |
| <form action="./" method="post" name="ff" class="ff" id="ff" onsubmit=""><input type="hidden" name="error_return_url" value="/index.php?mid=schoolnotice&m=1&act=dispBoardWrite" /><input type="hidden" name="act" value="dispBoardWrite" /><input type="hidden" name="vid" value="" /> | |
| <input type="hidden" name="mid" value="schoolnotice" /> | |
| <input type="hidden" name="document_srl" value="" /> | |
| <ul> | |
| <li> | |
| <label for="nCategory">카테고리</label> | |
| <select name="category_srl" id="nCategory"> | |
| <option value="3416" > | |
| 공지사항 (53) | |
| </option> | |
| <option value="3417" > | |
| 앱 공지사항 (7) | |
| </option> | |
| </select> | |
| </li> | |
| <li> | |
| <label for="nTitle">제목</label> | |
| <input name="title" type="text" id="nTitle" /> | |
| </li> | |
| <li> | |
| <label for="nText">내용</label> | |
| <textarea name="content" cols="20" rows="8" id="nText"></textarea> | |
| </li> | |
| <li> | |
| <label for="uName">글쓴이</label> | |
| <input name="nick_name" type="text" id="uName" /> | |
| </li> | |
| <li> | |
| <label for="uMail">이메일 주소</label> | |
| <input name="email_address" type="text" id="uMail" /> | |
| </li> | |
| <li> | |
| <label for="uPw">비밀번호</label> | |
| <input name="password" type="password" id="uPw" /> | |
| </li> | |
| <li> | |
| <label for="uSite">홈페이지</label> | |
| <input name="homepage" type="text" id="uSite" value="http://" /> | |
| </li> | |
| <li> | |
| <input type="checkbox" name="allow_comment" value="Y" checked="checked" id="reAllow" /> | |
| <label for="reAllow">댓글 허용</label> | |
| <input type="checkbox" name="allow_trackback" value="Y" checked="checked" id="trAllow" /> | |
| <label for="trAllow">엮인글 허용</label> | |
| </li> | |
| </ul> | |
| </form> | |
| </div> | |
| </div> | |
| <div class="bd"> | |
| <div class="hx h3"> | |
| <h3>파일첨부</h3> | |
| </div> | |
| <fieldset> | |
| <div class="hx"> | |
| <ul id="files" ></ul> | |
| </div> | |
| <div class="fix"> | |
| <img id="loading" src="/modules/board/m.skins/default/img/loading.gif" style="display:none;"> | |
| <form name="form" action="" method="POST" enctype="multipart/form-data"><input type="hidden" name="error_return_url" value="/index.php?mid=schoolnotice&m=1&act=dispBoardWrite" /><input type="hidden" name="act" value="dispBoardWrite" /><input type="hidden" name="mid" value="schoolnotice" /><input type="hidden" name="vid" value="" /> | |
| <input id="Filedata" type="file" name="Filedata" class="input" style="width:100%;" value=""> | |
| <div class="bna"> | |
| <button class="bn dark" id="buttonUpload" onclick="return ajaxFileUpload();">파일 업로드</button> | |
| <p>파일 선택 -> 파일 업로드</p> | |
| </div> | |
| </form> | |
| </div> | |
| </fieldset> | |
| </div> | |
| <div class="bna"> | |
| <a href="javascript:frmSubmit();" class="bn dark">등록</a> | |
| </div> | |
| <script type="text/javascript" src="/files/cache/js_filter_compiled/d046d1841b9c79c545b82d3be892699d.ko.compiled.js?20120427220558"></script> | |
| <script type="text/javascript" src="/files/cache/js_filter_compiled/b1faebdcc3b426676c00235bccd8a48e.ko.compiled.js?20120427220558"></script> | |
| <script type="text/javascript" src="/addons/autolink/autolink.js?20120407195933"></script> | |
| </body> | |
</html> |
밑줄친 부분이 파일 등록하는 웹페이지 요소 같습니다. 다른 브라우저에서는 잘되는데 웹뷰에서는 잘 되지 않습니다.
일단 아래것으로 파일 선택하는것은 해결했습니다.
web.setWebChromeClient(new WebChromeClient() {
// ICS 에서도 동작하기 위해서는 아래메소드도 넣어줘야함.
public void openFileChooser(ValueCallback<Uri> uploadFile, String acceptType) {
openFileChooser(uploadFile);
}
public void openFileChooser(ValueCallback<Uri> uploadMsg) {
uploadMessage = uploadMsg;
Intent i = new Intent(Intent.ACTION_GET_CONTENT);
i.addCategory(Intent.CATEGORY_OPENABLE);
i.setType("*/*");
startActivityForResult(Intent.createChooser(i, "File Chooser"), FILECHOOSER_RESULTCODE);
}
});
나중에 파일 업로드 버튼을 클릭하면 아무 반응 없습니다 . 브라우저랑 무슨 차이가 있길래 안되는걸까요.
ajax upload 라고 알고 있습니다. 아래 데모 사이트에서도 참고하실수 있을것 같습니다.
http://www.phpletter.com/Demo/AjaxFileUpload-Demo/




네이버앱이나 돌핀에서는 잘 되나요?^^
WebView 옵션중에 javaScript Enable 같은건 true 해주었겠죠?^^ㅋ