the below demo of code is suppose to store my image into a directory, however, using xammp i am confused on if i need permission to store it there as i am getting warnings and the file is not saving where i would like it to go.
<?php
//simple image check using getimagesize() instead of extensions
if($_FILES)
{
$empty_check = getimagesize($_FILES['file']['tmp_name']);
if(empty($empty_check))
{
echo 'this is not an image';
}
else
{
echo 'you have uploaded ' . explode('.',$_FILES['file']['name'])[0].' and it is a ' . explode('.',$_FILES['file']['name'])[1].'.';
//an example of how i would extract the extension
$target = "C:\xampp\tmp";
move_uploaded_file($_FILES['file']['tmp_name'], $target);
}
}
?>