0
I have a problem I couldn’t identify, move_uploaded_file
returns only FALSE
regardless of what I pass in the parameters. Follow 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
in $_FILES['img']
returns this array
Array
(
[name] => RgtoGIN.png
[type] => image/png
[tmp_name] => /tmp/phpfLzDGR
[error] => 0
[size] => 147270
)
Anorak, the solutions should be in the answers, not the question.
– Woss