Limit upload size with PHP to more than one file

0
Assuming there is a single array in the $_FILES variable, the code below limits the upload size of a file:

if(empty($_FILES) && empty($_POST) 
    && isset($_SERVER['REQUEST_METHOD']) 
    && strtolower($_SERVER['REQUEST_METHOD']) == 'post'){ //pega o erro de tamanho maximo excedido

        $postMax = ini_get('post_max_size'); //pega limite máximo
        echo "Arquivo enviado excede: $postMax"; // exibe o erro
}
else {// continua com o processamento da página

    echo "<pre>";
    print_r($_FILES);
    echo "<pre/>";
}

However, I have more than one array of type file , that is: $_FILES['logotipo'] and $_FILES['certificado'] . How would you adjust the response, or do this limitation individually for each file?

Reference: Limit upload size with PHP

    
asked by anonymous 10.08.2017 / 19:18

0 answers