Upload PHP does not send certain files

1

Colleagues.

I am using the basic means of uploading files, since extension validation is done in isolation. Our server is limited to files up to 100MB, but when testing, some files will usually, but a file with 51MB will not. It does not give error, only the page of a reload and does not send. The code is as follows:

$arquivoNome = $_FILES['Arquivos']['name'];
$arquivoTemp = $_FILES['Arquivos']['tmp_name'];

list($arquivo, $extensao) = explode(".",$arquivoNome);
    $codificar = md5(date('h:i').$arquivo).".".$extensao;
    $dirArquivo = "uploads/pdf/";
    $upArquivo = $dirArquivo . basename($codificar);

    if(move_uploaded_file($arquivoTemp, $upArquivo)){
       // Aqui cadastro no banco 
    }

Very strange, because the files are of the same PDF extension, what differentiates it is the size. Files with 20MB for example go, but the 50MB will not ...

    
asked by anonymous 09.05.2016 / 14:43

1 answer

1

When I needed to configure the maximum upload limit and did not have access to php.ini I decided to configure it in htacess like this:

<IfModule mod_php5.c>
   php_value upload_max_filesize 100M
   php_value post_max_size 100M
</IfModule>

Here is a reference of where you can put these settings: link

In this case being of the category: PHP_INI_PERDIR , version 5.3 or later.

    
09.05.2016 / 15:00