如何使用引导文件输入删除上传的文件

时间:2018-11-04 18:48:13

标签: javascript jquery-plugins bootstrap-file-input

我想删除使用引导文件输入上传的文件 我该怎么做?

文件上传代码:

filenameElement.fileinput({
        maxFileCount: 5,
        maxFileSize: 5120,
        showBrowse: false,
        showRemove: false,
        showCaption: false,
        uploadAsync: false,
        browseOnZoneClick: true,
        uploadClass: 'btn btn-success',
        previewFileType: "image",
        allowedFileTypes: ['image'],
        allowedPreviewTypes: ['image'],
        allowedFileExtensions: ['jpg', 'png'],
        uploadUrl: "/specializedshoppingcenter/api/documents/save"
    }).on('filebatchuploadsuccess', function(event, data) {
        var response = data.response.date;
        response.forEach(function (element) {
            documentId.push(element.id);
            filenames.push(element.filename);
        });

        $('#documents').val(filenames);
        selectDocumentModalElement.modal('hide');
    });

0 个答案:

没有答案