当前位置:网站首页>fileinput.js php,fileinput

fileinput.js php,fileinput

2022-06-26 13:32:00 全栈程序员站长

大家好,又见面了,我是你们的朋友全栈君。

$(“#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(“”);

}).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);

});

发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/133837.html原文链接:https://javaforall.cn

原网站

版权声明
本文为[全栈程序员站长]所创,转载请带上原文链接,感谢
https://cloud.tencent.com/developer/article/2030563