I have a website where I allow users to upload photos of any type.
I.e gif, jpeg, png
Now, how can I convert the files on upload to JPEG, if they aren't already?
Thanks
Here is my PHP:
if ($_FILES['media']['size'] != 0) {
$target= UPLOADPATH . $media;
move_uploaded_file($_FILES['media']['tmp_name'], $target);
$query= "INSERT INTO posts (user_id, story, media, date, view, type) VALUES
('$user_id', '$story', '$media', now(), '$view', '1')";
mysqli_query($connect, $query)
or die('error with query 2');
}