Blogger Information
Blog 14
fans 0
comment 0
visits 17724
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
fileinput
echo_下宇的博客
Original
919 people have browsed it

 $("#uploadfile").fileinput({

            theme: 'explorer-fa',

            uploadUrl: upload_url + "?catalog=9",

            language: 'zh',

            overwriteInitial: false,

            initialPreviewAsData: true,

            maxFileCount: 3,

            initialPreview: pics,

            initialPreviewConfig: pic_configs,

            showAjaxErrorDetails:true

        }).on("fileuploaded", function (event, data, previewId, index) { //上传成功的回调

            console.log("上传成功");

            var file_url = data.response.url;

            //增加隐藏域

            $("#" + previewId).find(".kv-file-remove").attr("data-key", file_url);

            $("#" + previewId).append("<input type='hidden' name='logos[]' value='" + file_url + "' />");

        }).on('filedeleted', function (event, id, index) {       //删除原图片成功的回调

            console.log('id = ' + id + ', index = ' + index);

            alert("删除原图成功时的回调");

        }).on('filesuccessremove', function (event, key) { //删除新图片的回调

            //走ajax删除临时图片

            var file_path = $("#" + key).find(".kv-file-remove").attr("data-key");

            ajaxDelOssTemp(del_url, file_path);

        });


Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post