【问题标题】:jQuery File Upload : move_uploaded_file - error 3jQuery 文件上传:move_uploaded_file - 错误 3
【发布时间】:2014-11-12 02:55:05
【问题描述】:

我正在使用 blueimp (https://github.com/blueimp/jQuery-File-Upload) 的插件来上传文件。

我有一个问题,当我上传多个文件(如 20 张图片)时,前 7 个已正确上传,但出现 PHP 错误(上传的文件仅部分上传)。

这个插件有什么配置可以避免这个问题吗?

我是这样设置插件的:

$('#upload').fileupload({
    // This element will accept file drag/drop uploading
    dropZone: $('#drop'),
    maxFileSize: 5000000,
    acceptFileTypes: /(\.|\/)(gif|jpe?g|png)$/i,
    // This function is called when a file is added to the queue;
    // either via the browse button, or via drag/drop:
    add: function(e, data) {

        var tpl = $('<li class="working"><input type="text" value="0" data-width="48" data-height="48"' +
                ' data-fgColor="#0788a5" data-readOnly="1" data-bgColor="#3e4043" /><p></p><span></span></li>');

        // Append the file name and file size
        tpl.find('p').text(data.files[0].name)
                .append('<i>' + formatFileSize(data.files[0].size) + '</i>');

        // Add the HTML to the UL element
        data.context = tpl.appendTo(ul);

        // Initialize the knob plugin
        tpl.find('input').knob();

        // Listen for clicks on the cancel icon
        tpl.find('span').click(function() {

            if (tpl.hasClass('working')) {
                jqXHR.abort();
            }

            tpl.fadeOut(function() {
                tpl.remove();
            });

        });

        // Automatically upload the file once it is added to the queue
        var jqXHR = data.submit();
    },
    progress: function(e, data) {

        // Calculate the completion percentage of the upload
        var progress = parseInt(data.loaded / data.total * 100, 10);

        // Update the hidden input field and trigger a change
        // so that the jQuery knob plugin knows to update the dial
        data.context.find('input').val(progress).change();

        if (progress == 100) {
            data.context.removeClass('working');
        }
    },
    fail: function(e, data) {
        // Something has gone wrong!
        data.context.addClass('error');
    }

});

任何想法可能是什么问题?

感谢您的帮助

【问题讨论】:

    标签: php jquery file-upload blueimp


    【解决方案1】:

    试试 查看 : upload_max_filesize = 100M post_max_size = 100M

    在你的 php.ini 中

    【讨论】:

    • upload_max_filesize 和 post_max_size 等于 64M。为了测试,我正在尝试上传 25 张图片(3M)。
    【解决方案2】:

    我找到了一个解决方案,我将我的网络服务器上的 FastCGI 协议更改为 CGI 并且它可以工作 ;-)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2023-01-22
      • 1970-01-01
      • 2015-02-17
      • 2018-05-13
      • 2016-07-29
      • 2020-06-21
      • 1970-01-01
      相关资源
      最近更新 更多