我试图弄清楚如何使用 Bootstrap Validator 插件设置文件上传的 minSize。
鉴于以下代码,我可以设置 maxSize maxSize
,但不能设置 minSize
$(document).ready(function () {
$('#test').bootstrapValidator({
live: 'enabled',
fields: {
fileupload: {
validators: {
file: {
extension: 'png',
type: 'image/png',
maxSize: 1024 * 1024,
message: 'The selected file is not valid, or the size is not large enough!'
}
}
}
}
});
});
有没有办法设置minSize?
最佳答案
如 nghuuphuoc/bootstrapvalidator
validators: {
file: {
extension: 'png',
type: 'image/png',
minSize: 1024*1024,
message: 'Please choose a png file with a size more than 1M.'
}
}
关于twitter-bootstrap - 如何在 Bootstrap Validator 中设置 minSize,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25649867/