2014-09-17 4 views
0

Я использую плагин от blueimp (https://github.com/blueimp/jQuery-File-Upload) для загрузки файлов.jQuery Загрузка файла: move_uploaded_file - ошибка 3

У меня проблема, когда я загружаю несколько файлов (например, 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'); 
    } 

}); 

Любые идеи, что может быть проблема?

Спасибо за вашу помощь

ответ

1

Попробуйте Проверить: upload_max_filesize = 100M post_max_size = 100M

В вашем php.ini

+0

upload_max_filesize и post_max_size равны 64M. Для теста я пытаюсь загрузить 25 изображений (3M). – bidou88

+0

Вы работаете с wordpress? – demenvil

0

Я нашел решение, я изменил FastCGI протокол к CGI на мой веб-сервер и он работает ;-)

Смежные вопросы