自定义jQuery文件上传的maxNumberOfFiles
我想允许用户只上传一个文件在某些网页和超过一个文件在其他网页上。 有地方可以换这个号码自定义jQuery文件上传的maxNumberOfFiles,jquery,file-upload,multifile-uploader,Jquery,File Upload,Multifile Uploader,我想允许用户只上传一个文件在某些网页和超过一个文件在其他网页上。 有地方可以换这个号码 var parentWidget = ($.blueimpFP || $.blueimp).fileupload; $.widget('blueimpUI.fileupload', parentWidget, { options: { // By default, files added to the widget are uploaded as soon // as
var parentWidget = ($.blueimpFP || $.blueimp).fileupload;
$.widget('blueimpUI.fileupload', parentWidget, {
options: {
// By default, files added to the widget are uploaded as soon
// as the user clicks on the start buttons. To enable automatic
// uploads, set the following option to true:
autoUpload: false,
// The following option limits the number of files that are
// allowed to be uploaded using this widget:
maxNumberOfFiles: undefined,
但如果我在这里更改它,它将应用于网站上的所有jQuery上传文件控件。如何自定义选项maxNumberOfFiles以达到我的目的。您是否可以在每个页面的选项中定义值 第1页
{ maxNumberOfFiles: 5}
第2页
{ maxNumberOfFiles: 1}
或者将其包装在自己的函数中,以arg形式传入所需的文件数
编辑:
好的-自从我发布这篇文章后,你稍微改变了这个问题,但同样的事情也适用