问题描述
$("#pic_upload").fileupload({
dataType: "json",minFileSize: 1,maxFileSize: 10485760 //10 MB,acceptFileTypes: /(.|\/)(gif|jpe?g|png|bmp)$/i
}).on("fileuploadprocessalways",function(e,data) {
var currentFile = data.files[data.index];
if(data.files.error && currentFile.error) {
alert(currentFile.error);
data.abort();
}
}).on("fileuploaddone",data) {
console.log(data);
data.context =
$("<li class='file done' id='file_" + data.files[0].name + "'>").append(
$("<div class='pic_list_wrap'>").append(
$("<span class='img'>").append(
$("<img src='" + data.result.files[0].url + "'>")
)
).append(
$("<span class='imgDeleteBtn' style='cursor: pointer;'>")
)
).appendTo(document.getElementById("pic_list"));
data.context.find("span.imgDeleteBtn").on("click",{filename: data.files[0].name,files: data.files},function(event) {
var removeItem = $(document.getElementById("file_" + event.data.filename));
removeItem.remove();
data.files.length = 0;
pictureCount -= 1;
writeFormData.delete(pictureCount);
});
writeFormData.append(pictureCount,data.files[0]);
pictureCount += 1;
});
我该如何解决这个问题????
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)