kartik-v / bootstrap-fileinput

An enhanced HTML 5 file input for Bootstrap 5.x/4.x./3.x with file preview, multiple selection, and more features.
http://plugins.krajee.com/file-input
Other
5.36k stars 2.4k forks source link

Hi I have issue when choose image for upload (overwriteInitial= false) if I choose image one by one image data it's have only one .Example in this video. https://share.vidyard.com/watch/VgoAkRBNXoZhJCwM8pwCYP? #1830

Open modlenine opened 1 year ago

modlenine commented 1 year ago

Prerequisites

Steps to reproduce the issue

1. 2. 3.

Expected behavior and actual behavior

When I follow those steps, I see...

I was expecting...

Environment

Browsers

Operating System

Libraries

Isolating the problem

horsebuzz commented 1 year ago

Same is happening with me as well.

Following is my fileinput code

$("#emailAttachments").fileinput({ overwriteInitial: false, preferIconicPreview: true, theme: "fa4", showUpload: false, maxFileSize: 5120, ajaxDeleteSettings: { beforeSend: function (xhr, settings) { xhr.setRequestHeader("X-CSRF-TOKEN", $('meta[name="csrf-token"]').attr('content')); } }, mergeAjaxDeleteCallbacks: true, maxFileCount: 10, allowedFileExtensions: ['jpg', 'jpeg', 'png', 'pdf', 'doc', 'docx', 'xls', 'xlsx'] }).on('filedeleted', function () { setTimeout(function () { window.alert('File deletion was successful! '); }, 900); });

I have deduced that the problem is in _hasInitialPreview functions self.previewCache.count(true) method. Line 3319

It returns 0 where I believe it should return number of already uploaded/previewed file.