I have a problem that I could not identify, move_uploaded_file
returns only FALSE
regardless of what I pass in the parameters. Here is the code:
<form method="POST" enctype="multipart/form-data">
<input type="file" name="img" />
<input type="submit" value="Enviar" />
<input type="hidden" name="MAX_FILE_SIZE" value="1024000" />
</form>
$way = BASE_URL."media/";
$name = basename($_FILES['img']['name']);
$uploadfile = $way.$name;
if (move_uploaded_file($_FILES['img']['tmp_name'], $uploadfile)) {
echo "Estou aqui!";
} else {
echo "Não foi dessa vez.";
}
Giving a print_r
to $_FILES['img']
returns this array
Array
(
[name] => RgtoGIN.png
[type] => image/png
[tmp_name] => /tmp/phpfLzDGR
[error] => 0
[size] => 147270
)