1
Colleagues.
I’m using the basic means of uploading files, since the extension validation is done alone. Our server is limited to files up to 100MB, but when testing, some files will normally, but a 51MB file won’t. No error, only the page of a Reload and does not send. The code follows below:
$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 is the size. Files with 20MB for example go, but the 50MB will not...
See if there are any error messages in the server error log.
– Rodrigo Rigotti
This message appears: [09-May-2016 12:35:30 UTC] PHP Warning: POST Content-Length of 51662811 bytes Exceeds the limit of 8388608 bytes in Unknown on line 0.... but how strange... we put to 100MB
– user24136
Make sure you have not changed php.ini for the command line instead of php.ini for the web server. Try restarting the server. It is also possible that you have multiple local PHP installations (in this case, see which php.ini is used by the command
phpinfo()
).– Rodrigo Rigotti
We don’t actually have access to php.ini because we’re using a cloud. phpinfo() is upload_max_filesize 100M 100M
– user24136
but on that line is 8MB post_max_size
– user24136
I think it is in this line Rodrigo. I will change and return...
– user24136
That’s the problem. The sum of the size of all files has to be less than or equal to the size of the POST. Just adjust the directive
post_max_size
for the same100M
.– Rodrigo Rigotti
Right Rodrigo. I’ll change here and return ;)
– user24136