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

The files that i've uploaded were replaced #1729

Closed RayhanYulanda closed 3 years ago

RayhanYulanda commented 3 years ago

Prerequisites

Steps to reproduce the issue

I've download the newest package and I've import the js and css but i got problem that the package replace the files that i've input not extend the exist files. Another problem is I can't remove the single file, it just can remove the entire files

Expected behavior and actual behavior

When I follow those steps, I see files replaced I was expecting that the files not replaced and can remove a single file.

Here is it the code <input id="files" name="files[]" class="file" type="file" data-theme="fas" accept="image/jpeg,image/jpg,image/png,application/pdf" required multiple>

And this is the js

$("#files").fileinput({
                previewFileType: 'any',
                showRemove: true,
                showUpload : false,
                maxFileSize: 5000,
                allowedFileExtensions: ["png", "jpg", "jpeg", "pdf"],
                showClose: false,
                language: 'id',
});

Environment

Browsers

Operating System

Libraries

Isolating the problem

kartik-v commented 3 years ago

Duplicate to #1724. Read this comment.

Also please read docs and the usage modes of the plugin to understand why this is happening. Appending files to a selection or selectively deleting files is only supported via Ajax Mode and not via the Form Submission mode. Check the comparison of modes.