0
I’m trying to receive the dimensions of each photo sent, but when I run the file happens this:
Error:
Warning: chmod(): Invalid argument in C:\Program Files (x86)\EasyPHP-
Devserver-17\eds-www\PPI\adm\cadastrar_jogo.php on line 15
Warning: getimagesize(): Filename cannot be empty in C:\Program Files
(x86)\EasyPHP-Devserver-17\eds-www\PPI\adm\cadastrar_jogo.php on line 16
Here is the part of the code that is giving the error:
for ($i = 0; $i < count($_FILES['img']); $i++){
if (isset($_FILES['img']['name'][$i])){
if (!empty($_FILES['img']['name'][$i])){
chmod($_FILES['img']['tmp_name'][$i], 0777);
list ($larg, $alt) = getimagesize($_FILES['img']['tmp_name'][$i]);
$verifica_quant_img++;
How can I solve the problem, and what exactly is the problem?
Hello William, the problem is that I am sending files in input, but when I send a PNG type image the error of the function getimagesize(). So I used chmod() because I thought it was something related to permissions, since PNG files are usually bigger...
– shelldude
@shelldude may be upload failure, make the check first (above all) as in the example
if ($arquivos['error'][$i] !== UPLOAD_ERR_OK)
– Guilherme Nascimento