I have a php file that creates a thumbnail using an uploaded image. If i use
imagejpeg( $tmp_img, $_FILES["file"]["name"] );
it saves the picture without any issues to the same directory that the upload.php file is in.
I want to save the picture to
imagejpeg( $tmp_img, "uploads/thumbnails/" + $_FILES["file"]["name"] );
where the uploads folder is in the same directory as the upload.php file. But this doesnt seem to work... where have i gone wrong?
You need to use the .
in place of +
in:
imagejpeg( $tmp_img, "uploads/thumbnails/" + $_FILES["file"]["name"] );
^
.
is the string concatenation operator in PHP.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With