i get an image from a php form, but i don't recive all the information from the form. The code is below:
<form action="pages/post/upload.php" enctype='multipart/form-data' method="post">
<input type="file" name="userfile" required/>
<input type="submit" name="send" value="Invia"/>
</form>
<?php
$uploaddir = '/home/pino/Scrivania/Prova/upload/';
$uploadfile = $uploaddir . basename($_FILES['userfile']['name']);
print_r($_FILES['userfile']['name']);
print_r($uploadfile);
print_r($_FILES['userfile']['tmp_name']);
echo '<pre>';
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile))
{
echo "File is valid, and was successfully uploaded.\n";
}
else {
echo "Possibile attacco tramite file upload!\n";
}
echo 'Alcune informazioni di debug:';
print_r($_FILES);
print "</pre>";
?>
When i print the content of the file with print_R($_FILES);
i recive the follow:
Array
(
[userfile] => Array
(
[name] => IMG_20170318_072135.jpg
[type] =>
[tmp_name] =>
[error] => 1
[size] => 0
)
)