now use the bootstrap fileinput control to upload files, for example, only 10 files can be uploaded to, maxFileCount: 10, but after users upload 4 files, how does the maxFileCount in option become 6 dynamically? MaxFileCount:6
now use the bootstrap fileinput control to upload files, for example, only 10 files can be uploaded to, maxFileCount: 10, but after users upload 4 files, how does the maxFileCount in option become 6 dynamically? MaxFileCount:6
what I know is that you need a plug-in to do it. http://plugins.krajee.com/fil.
<input value="" name="check_nums" class="check_nums">
$(document).on('ready', function() {
var check_nums = $(".check_nums").val();
$('-sharpfile-th').fileinput({
showUploadedThumbs: false,
language: 'th',
uploadAsync: false,
maxFileCount: check_nums,
resizePreference: 'height',
resizeImage: true,
overwriteInitial: false,
validateInitialCount: true,
showUpload: false,
allowedFileExtensions: ['jpg', 'png', 'jpeg'],
previewSettings: {
image: {width: "auto", height: "100px"},
object: {width: "213px", height: "160px"},
},
layoutTemplates: {
actions: '<div class="file-actions">\n' +
' <div class="file-footer-buttons">\n' +
' {delete}' +
' </div>\n' +
'</div>',
}
}).on("filebatchselected", function(event, files) {
});
});
//
$(".check_nums").change(function(){
$("-sharpfile-th").fileinput('maxFileCount',$(this).val());
});
this practice has bug. If the limit has been reached, the maxFileCount will be 0, or even the previous historical data will be negative, resulting in invalid maxFileCount
.Previous: Alpine, installed by VMWare installs Docker in Alpine prompting the need for cgroup
Next: How is a background management system like this implemented?
at present, the project uses bootstrap fileinput to upload images, but when it encounters txt or other document formats, it has a very friendly preview of the contents, but the Chinese support is not very good. I want to only preview images, other format...