웹마스터 팁

그냥재미로님의 모바일 파일 업로드 지원 게시판이 있는데

요걸 잘하면 스케치북5 모바일 게시판도 업로드가 가능 하게 할 수 있지 않을 까해서

끄적이다 아주그냥 대공사를 하고 말았습니다 ㅠㅠ


테스트 기종

아이폰4S IOS 5.1.1

갤석시S3 4.1

모두 이상 없이 잘됩니다.


먼저 write_form.html 8번째 줄

<!--%import("css/board.css")-->

밑에 추가 해줍니다.

write_form.html
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
<!--%import("./js/ajaxfileupload.js")-->
 
<?php
include_once(_XE_PATH_.'/modules/file/file.class.php');
include_once(_XE_PATH_.'/modules/file/file.controller.php');
$oFileController = &getController('file');
 
if(!$_SESSION['_editor_sequence_']) $_SESSION['_editor_sequence_'] = 1;
$editor_sequence = $_SESSION['_editor_sequence_'] ++;
$oFileController->setUploadInfo($editor_sequence, $upload_target_srl);
$_SESSION['upload_info'][$editor_sequence]->enabled = true;
$_SESSION['upload_info'][$editor_sequence]->upload_target_srl = $upload_target_srl;
?>
<style type="text/css">
.success {
border-width: 1px;
border-style: dotted;
border-color: blueViolet;
padding: 10px;
}
.success img {
display: block;
}
.success a {
margin-left: 10px;
font-weight: bold;
}
</style>
<script type="text/javascript" >
jQuery.extend({
    handleError: function( s, xhr, status, e ) {
        // If a local callback was specified, fire it
        if ( s.error )
            s.error( xhr, status, e );
        // If we have some XML response text (e.g. from an AJAX call) then log it in the console
        else if(xhr.responseText)
            console.log(xhr.responseText);
    }
});
    function ajaxFileUpload()
    {
        if(document.getElementById('Filedata').value ==""){
            alert("파일을 선택하세요");
            return false;
        }
 
        var up=jQuery("#t_document_srl").attr("value");
 
        jQuery.ajaxFileUpload
        (
            {
                url:'index.php?&act=procFileIframeUpload',
                secureuri:false,
                fileElementId:'Filedata',
                dataType: 'html',
                data:{
                mid: '{$mid}',
                editor_sequence: '1',
                uploadTargetSrl: up,
                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;
 
                jQuery("#t_document_srl").attr("value",document_srl);
 
            //  document.getElementById('Filedata').value ='aaa';
                 
                if(uploadFile != ""){
                    var Extension = uploadFile.substring(uploadFile.lastIndexOf('.') + 1).toLowerCase();
                    if (Extension == "gif" || Extension == "png" || Extension == "bmp" || Extension == "jpeg" || Extension == "jpg") {
                    jQuery('<li id="'+file_srl+'" class="wrt_opt"></li>').appendTo('#files').html('<img width="50px" height="atuo" src="'+uploadFile+'" /><span class="filename">'+sourceFile+'</span><a href="javascript:delete_file('+file_srl+',1)" class="abn dark">{$lang->cmd_delete}</a>').addClass('success');
                    }
                    else
                    {
                    jQuery('<li id="'+file_srl+'" class="wrt_opt"></li>').appendTo('#files').html('<span class="filename">'+sourceFile+'</span><a href="javascript:delete_file('+file_srl+',1)" class="abn dark">{$lang->cmd_delete}</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();
}
jQuery($).ready(function($){
    $("#loading_dialog")
    .ajaxStart(function(){
        $(this).show();
        $("#loading_form").hide();
    })
    .ajaxComplete(function(){
        $(this).hide();
        $("#loading_form").show();
    });
});
</script>



그 다음 같은 파일에서

<li>

<label for="nText">{$lang->content}</label>

<textarea name="content" cols="20" rows="8" id="nText"></textarea>

</li>

요렇게 생긴 놈 밑에 추가 합니다.

write_form.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<ul id="files" >
</ul>
<li class="wrt_locate">
    <div id="loading_dialog" style="display:none">
        <img id="loading" src="./img/loading.gif">
        <p>잠시만 기다려 주세요</p>
    </div>
    <div id="loading_form">
    <label for="nFileUpload">파일첨부</label>
        <input id="Filedata" type="file"  name="Filedata" class="input" style="width:100%;" value="">
        <button type="button" id="buttonUpload" onclick="return ajaxFileUpload();" class="btn">파일 업로드</button>
        <p>파일을 먼저 업로드하신 후 등록하세요</p>
    </div>
</li>


그다음은 ./js/ 폴더에

ajaxfileupload.js

이 파일을 올려 줍니다.


아마도 이렇게 하면 됩니다.


이게 힘들다 싶으면

sketchbook5Mobile.zip

이파일을 덮어 쓰셔도 됩니다.

제목 글쓴이 날짜
안산오피 ⦑출장안마사이트.COM⦒ 안산오피 안산OP 안산건마 안산오피 koykoyah 2025.02.23
해운대오피 해운대출장안마 ⦑오피쓰.COM⦒ 해운대OP 해운대오피 해운대오피 koykoyah 2025.02.23
영등포오피 ⦑오피사이트.NET⦒ 영등포오피 영등포출장마사지 영등포오피 영등포OP koykoyah 2025.02.23
익산오피 ⦑오피쓰.COM⦒ 익산오피 익산출장마사지 익산오피 익산OP koykoyah 2025.02.23
압구정오피 ⦑오피쓰주소.COM⦒ 압구정오피 압구정OP 압구정건마 압구정오피 koykoyah 2025.02.23
강남오피 ⦑출장마사지안내.COM⦒ 강남오피 강남OP 강남건마 강남오피 koykoyah 2025.02.23
가락오피 ⦑오피사이트.NET⦒ 가락오피 가락OP 가락건마 가락오피 koykoyah 2025.02.23
압구정오피 ⦑오피사이트.NET⦒ 압구정오피 압구정출장마사지 압구정오피 압구정OP koykoyah 2025.02.23
압구정안마【오피쓰.COM】압구정마사지 압구정1인샵 압구정스웨디시 songkangkong767 2025.02.23
제주스웨디시【오피쓰.COM】제주마사지 제주1인샵 제주안마 songkangkong767 2025.02.23
건대1인샵【오피쓰.COM】건대마사지 건대안마 건대스웨디시 songkangkong767 2025.02.23
홍대스웨디시【오피사이트.NET】홍대안마 홍대마사지 홍대1인샵 songkangkong767 2025.02.23
동탄마사지【오피쓰.COM】동탄안마 동탄1인샵 동탄스웨디시 songkangkong767 2025.02.23
평촌1인샵【오피쓰.COM】평촌1인샵 평촌 1인샵 평촌1인샵 songkangkong767 2025.02.23
인천1인샵【출장안마사이트.COM】인천안마 인천스웨디시 인천마사지 songkangkong767 2025.02.23
인천1인샵【오피.CLUB】인천 1인샵 인천1인샵 인천1인샵 songkangkong767 2025.02.23
대구오피 ⦑출장마사지안내.COM⦒ 대구OP 대구오피 대구출장샵 대구오피 koykoyah 2025.02.23
의정부안마【오피.CLUB】의정부마사지 의정부스웨디시 의정부1인샵 songkangkong767 2025.02.23
평택오피 ⦑오피쓰주소.COM⦒ 평택OP 평택오피 평택출장샵 평택오피 koykoyah 2025.02.23
여의도안마【출장안마사이트.COM】여의도1인샵 여의도스웨디시 여의도마사지 songkangkong767 2025.02.23