2
프로젝트에서 이미지를 업로드 할 때 Blueimp 파일 업로드를 사용하고 있습니다. 이미지를로드 한 후 업로드하기 전에 업로드 대기열에서 지울 수있는 각 이미지에 대한 버튼을 배치하려고합니다 (플러그인의 데모 페이지 @http://blueimp.github.io/jQuery-File-Upload/의 것과 같습니다). 나는Blueimp fileuplad - 업로드하기 전에 대기열에서 파일을 제거하는 방법
$('#fileupload').fileupload({
dataType: 'json',
autoUpload: false,
acceptFileTypes: /(\.|\/)(gif|jpe?g|png)$/i,
disableImageResize: /Android(?!.*Chrome)|Opera/
.test(window.navigator.userAgent),
imageMaxWidth: 1000,
imageMaxHeight: 800,
previewMaxWidth: 100,
previewMaxHeight: 100,
previewCrop: false
}).on('fileuploadadd', function (e, data) {
//Add buttons for canceling individual images
$("#uploadBttn").click(function() {
data.submit();
});
}).on('fileuploadprocessalways', function (e, data) {
var index = data.index,
file = data.files[index];
if (file.preview) {
$("#imgPreview").append(file.preview);
}
}).on('fileuploadprogressall', function (e, data) {
var progress = parseInt(data.loaded/data.total * 100, 10);
$('#progress .bar').css('width',progress + '%');
}).on('fileuploadstart', function (e) {
$("#uploadBttn").unbind().prop('disabled', true).text('Uploading...');
}).on('fileuploadstop', function (e) {
$("#uploadBttn").text('Done!');
});
가능한 중복 [업로드가 blueimp 기본에서 시작하기 전에 업로드를 중단 대기열에서 파일을 제거하는 방법?] (http://stackoverflow.com/questions/18267958/업로드 전 대기열에서 업로드하기 전에 업로드하는 방법 (blueimp에서 시작) –
예. 나는 그 질문을 보았고, 나의 재료를 위해 그것을 시도했다. 이렇게하면 파일 항목이 테이블에서 제거되지만 실제로 업로드 대기열에서 파일 항목이 제거되지는 않습니다. 업로드 버튼을 클릭하면 테이블에서 제거한 파일을 포함하여 모든 파일이 업로드됩니다. – user2865595
모든 단일 파일에 대한 버튼을 추가하고 제출을 바인드하십시오. –