2
Guys like me block an upload larger than 2mb?
I’m capturing the file like this:
$imagem = $_FILES["imagem"];
2
Guys like me block an upload larger than 2mb?
I’m capturing the file like this:
$imagem = $_FILES["imagem"];
5
Each $_FILES key/file pussui a key size
, that by default comes measured in bytes. We can convert like this
for 2mb:
if($_FILES['imagem']['size'] > 2097152) {
echo 'não é permitido';
}
To 2gb:
if($_FILES['imagem']['size'] > 2147483648) {
echo 'não é permitido';
}
Note that for 2gb is a large file, you must have the right settings in the server, php.ini:
post_max_size = 2048M
upload_max_filesize = 2048M
Browser other questions tagged php
You are not signed in. Login or sign up in order to post.