贴出我的代码,由于我的代码是写在thinkcmf框架中的,一些引用的js和css就看不到了,不过我能确保引用不会出错,上传图片的路径我也能保证不会出错,因为我的路径是拷贝thinkcmf前台上传头像的路径,一般也错不了,可是我点了上传按钮后,就提示“You must select at least 2 files to upload. Please retry your upload!”,哪位大神用过这个的,帮我看看,谢谢!
<admintpl file="header" />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml&...
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<body>
<div class="container kv-main">
<br>
<form enctype="multipart/form-data">
<div class="form-group">
<input id="file-1" type="file" multiple class="file" data-overwrite-initial="false" data-min-file-count="2">
</div>
</form>
{:U("__URL__",array())}
</div>
</body>
</html>
<script>
$("#file-1").fileinput({
uploadUrl: '__UPLOAD__partner/img', // you must set a valid URL here else you will get an error
allowedFileExtensions : ['jpg', 'png','gif'],
overwriteInitial: false,
maxFileSize: 1000,
maxFilesNum: 10,
//allowedFileTypes: ['image', 'video', 'flash'],
slugCallback: function(filename) {
return filename.replace('(', '_').replace(']', '_');
}
});
</script>
请输入代码
将data-min-file-count="2"这个属性改为data-min-file-count="1"