简体   繁体   English

jQuery File Upload:move_uploaded_file-错误3

[英]jQuery File Upload : move_uploaded_file - error 3

I'm using the plugin from blueimp ( https://github.com/blueimp/jQuery-File-Upload ) to upload files. 我正在使用blueimp( https://github.com/blueimp/jQuery-File-Upload )的插件上传文件。

I have a problem, when I'm uploading several files (like 20 pictures), the first 7 are uploaded correctly but after I get the PHP error (The uploaded file was only partially uploaded). 我有一个问题,当我上传多个文件(例如20张图片)时,前7个文件已正确上传,但是在收到PHP错误后(上传的文件仅部分上传)。

Is there something to configure with this plugin to avoid this problem ? 是否可以使用此插件进行配置以避免此问题?

I set the plugin like that : 我这样设置插件:

$('#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');
    }

});

Any ideas what could be the problem ? 任何想法可能是什么问题?

Thanks for your help 谢谢你的帮助

Try Check : upload_max_filesize = 100M post_max_size = 100M 尝试检查:upload_max_filesize = 100M post_max_size = 100M

In your php.ini 在你的php.ini中

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM