【问题标题】:Customize maxNumberOfFiles of jQuery File Upload自定义 jQuery 文件上传的 maxNumberOfFiles
【发布时间】:2012-06-27 10:57:25
【问题描述】:

我想允许用户在某些页面上仅上传 1 个文件,而在其他页面上仅上传 1 个以上的文件。 有地方可以改这个号码

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 Upload File 控件。如何自定义选项 maxNumberOfFiles 以实现我的目的。

【问题讨论】:

    标签: jquery file-upload multifile-uploader


    【解决方案1】:

    你能不能只在每个页面的选项中定义值?

    第 1 页

    { maxNumberOfFiles: 5}
    

    第 2 页

    { maxNumberOfFiles: 1}
    

    或者将它包装在它自己的函数中,将你想要的文件数量作为参数传递?

    编辑: 好的 - 自从我发布这个问题以来,你已经稍微改变了这个问题,但同样的事情也适用

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-05-26
      • 2013-02-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多