0
Blueimp jQuery File Upload을 사용하고 있는데 문제가 없지만 파일 중 하나의 업로드를 취소하는 데 문제가 있습니다.Blueimp jQuery 파일 업로드를 사용하여 단일 파일의 업로드 취소 방법
파일을 추가 할 때 html 하나의 필드 세트에 몇 가지 추가 입력과 하나의 버튼 ("취소")이 추가됩니다. 여기
$(".cancelUpload").on("click", function(){
//remove this file from the queue, The data and the file will not be uploaded
})
방금 클래스 "취소"를 추가 할 필요가
$('#MappeFile').fileupload({
dataType : 'json',
autoUpload : false,
maxNumberOfFiles : undefined,
maxFileSize : 2000,
minFileSize : undefined,
acceptFileTypes : /.+$/i,
url : "/ajax/UploadFile.php",
add : function(e, data) {
$("#fileUploadButton").removeClass("toHide").on("click", function() {
$('#progress .bar').show();
if ($.browser.msie && parseInt($.browser.version, 10) < 10) {
$('#progress .bar').css({
"background" : "url(images/progressbar.gif) no-repeat",
"width" : "100%"
})
} else {
$('#progress .bar').css({
'background-color' : "#2694E8",
'width' : '0%'
});
}
data.formData=$("form").serializeArray();
data.submit();
$("#fileUploadButton").off("click").addClass("toHide")
})
},
change : function(e, data) {
$.each(data.files, function(index, file) {
filesCount++;
vOutput = "<fieldset class='FileUploadFieldset'>"
vOutput += "<legend>" + file.name + "</legend>"
vOutput += "<label>Dateiname:</label><input type='text' value='"+file.name+"' name='Dateiname"+filesCount+"' size='50' class='UploadDateiName inputMaske'/><input type='text' class='toHide originName' name='originName"+filesCount+"' value='"+file.name+"'/>"
vOutput += "<label>Dokumentdatum</label><input type='text' name='Datum"+filesCount+"' class='UploadDatum inputMaske'>"
vOutput += "<label>Berater:</label><select name='Berater"+filesCount+"' class='UploadBeraterSelect inputMaske'></select>"
vOutput += "<fieldset><legend>Kategorie:</legend><div class='UploadKategorie'></div></fieldset>"
vOutput += "<fieldset><legend>Bemerkung:</legend><textarea name='Bemerkung"+filesCount+"' class='UploadBemerkung inputMaske'></textarea></fieldset>"
vOutput += "<input type='button' class='cancelUpload neuButton' value='cancel'/>"
vOutput += "</fieldset>"
$("#MappeFilesToUpload").append(vOutput);
});
}
});
이 전체 양식을 재설정합니다,하지만 난 파일의 한, 모든 –
당신이 시도 했나요을 취소하려면? 내 생각에 각 파일은 다른 양식으로 제출됩니다. –
아니요, 모든 파일이 하나의 양식에 있습니다. 내 HTML 코드 –