XE 모듈을 제작하고 있는데요, XE 파일모듈이랑 연동을 해서 이미지를 서버로 업로드 하고 싶습니다.
혹시 예제라던지 참고할만한 모듈이 있을까요?
PHP | PHP 7.2 |
---|---|
CMS | Rhymix |
XE 모듈을 제작하고 있는데요, XE 파일모듈이랑 연동을 해서 이미지를 서버로 업로드 하고 싶습니다.
혹시 예제라던지 참고할만한 모듈이 있을까요?
저는 예전에 쪽지함에서 파일전송하는 구현을 하였었는데... 작동은 잘 되었습니다....
혹시 몰라 아래에 소스 남깁니다.
<block cond="$input_imgs"> {@ $module_info = Context::get("module_info"); $module_srl = $module_info->module_srl; $upfile= Context::get("input_imgs"); $upload_target_srl = "000"; $oFileController = getController('file'); $output = $oFileController->insertFile($upfile, $module_srl, $upload_target_srl); $output2 = $output->variables[uploaded_filename]; } <[email protected]($output->error=="-1")--> <script>alert("{$output->message}");</script> <[email protected]> <script>$(function () { $("#title").val('이미지파일ㅤ'); document.getElementById("content").value = '{$output2}'; $.ajax({ type: 'post', url: '', data: $('form').serialize(), success: function () { var url = location.href + " #container2"; $("#container").load(url); } }); document.getElementById("content").value = ''; });</script> <[email protected]> </block>
<form id="form" method="post" enctype="multipart/form-data" action="/"> <div id="footer"> <input name="input_imgs" type="file" id="input_imgs" multiple/> <a href="javascript:" onclick="fileUploadAction();"> <div class="imgbtn"><img class="file" src="img/file.png"></div></a> <div class="textarea"> <textarea class="edt" style="margin-top:10px;" id="content" name="content" rows="4" cols="2000"></textarea> <input type="hidden" id="title" name="title" value=""/> </div> <div class="sendbtn"> <input class="send" id="send" type="image" src="img/send.png"> </div> </div> </form>
// 이미지 정보들을 담을 배열 var sel_files = []; $(document).ready(function() { $("#input_imgs").on("change", handleImgFileSelect); }); function fileUploadAction() { console.log("fileUploadAction"); $("#input_imgs").trigger('click'); } function handleImgFileSelect(e) { // 이미지 정보들을 초기화 sel_files = []; $(".imgs_wrap").empty(); var files = e.target.files; ff = '1'; $("#send").trigger('click'); }
https://xe1.xpressengine.com/index.php?mid=download&package_id=22753684
자료가 있는데 벌써 3년이 넘어서 현재 잘 작동되는지는 모르겠네요
그 외에는.. 제 자료도 있긴한데
http://sejin7940.co.kr/index.php?mid=sejin7940_work&category=109909
이건 제작의뢰 받았을때만 사용하는거여서 분석용으로는 도움이 안 될거예요 ^^;
그 외에는 따로 제작된 예는 잘 모르겠네요
Core 수정으로 구현한 분들도 계실지도..