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 that's fine, 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 novo
folder.
In tests I freed the inherited share so that it would not have access to the folders.
I'm using Windows with WampServer.