Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/wcf/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何覆盖jquery文件上传插件选项_Jquery_File Upload - Fatal编程技术网

如何覆盖jquery文件上传插件选项

如何覆盖jquery文件上传插件选项,jquery,file-upload,Jquery,File Upload,我正在使用jquery文件上传插件和jquery UI 我想覆盖小部件选项,如maxUploadfilesize 如果我跳过主文件jquery.fileupload ui.js中的设置,则为当前设置 那就行了 var parentWidget = ($.blueimpFP || $.blueimp).fileupload; $.widget('blueimpUI.fileupload', parentWidget, { options: { /

我正在使用jquery文件上传插件和jquery UI

我想覆盖小部件选项,如
maxUploadfilesize

如果我跳过主文件
jquery.fileupload ui.js中的设置,则为当前设置

那就行了

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: true,
            //sequentialUploads, true,
            // The following option limits the number of files that are
            // allowed to be uploaded using this widget:
            maxNumberOfFiles: undefined,
            // The maximum allowed file size:
            maxFileSize: 20000000,
            // The minimum allowed file size:
            minFileSize: undefined,
有没有什么方法可以在我的html模板中覆盖它,以便对不同的html页面进行不同的自定义

我指的是一些我可以放在模板中覆盖默认设置的JAVscript代码,它们说您可以覆盖它们

把这段代码放在初始化插件的地方

$('#fileupload').fileupload(
    'option',
    {
        maxFileSize: 4000000,
        sequentialUploads: true
    }
);