FineUploader 5.14.0-setParams无法处理大文件

时间:2019-03-04 05:32:09

标签: fine-uploader

我(在过去的一年中)已经使用了以下代码一段时间,但是一个用户试图上传14MB的文件,我上传的额外数据似乎不再发布了。

在Chrome开发者工具中,我查看了(单个)XHR的标头,并且在“表单数据”部分中看到了数据,但是没有任何内容进入我不理解的服务器。

几MB或更小的文件可以正常工作。我还没有找到神奇的MB限制。

额外的数据在onUpload回调中。 board_hash在页面的顶部。

var fu_instance = new qq.FineUploader(
{
    element: $uploader[0],
    template: 'agenda_file_template',
    debug: true,
    request: {
        endpoint: '/m/upload',
        forceMultipart: false,
        customHeaders: {
            Accept: 'application/json'
        }
    },
    autoUpload: false,
    messages:
    {
        noFilesError: "There is no files to upload. Select or drag and drop some files to upload.",
    },
    failedUploadTextDisplay:
    {
        mode: 'custom',
        responseProperty: 'error'
    },
    callbacks:
    {
        onSubmit: function(id, filename)
        {
            // File added to upload
            $uploader.addClass('hide-drop-msg');

            $btn_submit_upload.html('Upload').show();

            unsaved = true;
        },
        onUpload: function(id, name)
        {
            fu_instance.setParams({'board_hash': board_hash, 'parent': $parent.val()});
        },
        onCancel: function(id, name)
        {
            // Actually onBeforeCancel
            if ($uploader.find('ul.qq-upload-list li').length == 1)
            {
                // There is currently 1 & it's about to be axed
                $uploader.removeClass('hide-drop-msg');
                $btn_reset_uploads.hide();
                $btn_submit_upload.html('Upload').show();
                unsaved = false;
            }
        },
        onError: function(id, name, reason, resp)
        {
            // Specific file error
            if (resp.hasOwnProperty('auth_expired'))
            {
                window.location.href = auth_url;
            }
        },
        onComplete: function(id, name, resp)
        {
            if (resp.success)
            {
                var $parent_el = $('#'+$parent.val());

                $parent_el.find('.files').append(resp.html);
                $parent_el.find('.no-agenda-files').hide();
            }
        },
        onAllComplete: function(succeeded, failed)
        {
            // Every file is done
            $btn_submit_upload.hide();
            $btn_reset_uploads.show();
            unsaved = false;
        }
    }
});

我的理解是,默认情况下分块功能处于关闭状态。我是否配置了错误的电话或回叫错误?

0 个答案:

没有答案