Given that getImagesize() requires a string and $_FILES['myfile']
is an array, I've tried to get to the temporary folder and the file uploaded there in order to get the image size, but I do get an error.
This is the error that I get:
Warning: getimagesize(/home/everymorning/public_html/tmp/phpNFuAMD/images.jpeg): failed to open stream: No such file or directory in /home/everymorning/public_html/demo1.php on line 48
And here is what I've tried:
$string = $_SERVER['DOCUMENT_ROOT'].$_FILES['myfile']['tmp_name'].'/'.$_FILES['myfile']['name'];
echo getimagesize($string);
And if I try to use the temporary path directly, I still get an error:
If I use:
getimagesize($_FILES['myfile']['tmp_name']);
I get:
Notice: Array to string conversion in /home/everymorning/public_html/demo1.php on line 47