如果上传图像很大(8M),为什么PHP ajax调用花费太长时间来响应?

时间:2018-01-28 13:03:21

标签: php jquery ajax

我正在使用PHP,jQuery / Ajax调用验证带有upload字段的表单。

现在如果上传的文件大小很大(现在是8MB),那么它需要花费很长时间(只需要花费3.7分钟)来响应!

enter image description here

我不明白为什么要花很多时间!

jQuery / Ajax代码:

$('#register').submit(function( e ) {
    e.preventDefault();        
    var formData = $('form').get(0);    
    $.ajax({
        type : 'POST', 
        dataType : 'html',
        data: new FormData(formData),
        url : 'process/ccroipr-cat-p.php', 
        cache:false,
        contentType: false,
        processData: false,
        beforeSend : function () {
            $('#result').html( 'Please wait...' );
            $('#registerButton').prop('disabled', true);
        },
        success : function ( result ) {            
            $('#registerButton').prop('disabled', false);
            $('#result').html( result );
        }
    });
});

PHP代码:

https://codeshare.io/GqQNwq

注册页面链接:

ccroipr.org/register.php

0 个答案:

没有答案