1
Based on the PHP documentation code on fileupload I created the following code:
<?php
$uploaddir = './novo/side';
$uploadfile = basename($_FILES['userfile']['name']);
echo '<pre>';
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
echo "Arquivo válido e enviado com sucesso.\n";
} else {
echo "Possível ataque de upload de arquivo!\n";
}
echo 'Aqui está mais informações de debug:';
print_r($_FILES);
print "</pre>";
?>
So far so good, when I use the HTML form it takes the file and brings it to the Project Root, the problem is that I want it to go to a folder that is inside the root called side
.
$uploaddir = './novo/side';
The result I have is that the file is only in the folder novo
.
In the tests I released the inherited share so that there was no impediment to access the folders.
I am using Windows with Wampserver.
I tried that already but not sure either, it keeps sending to the root.
– ipocampo