So, I have an image loading script. It downloads the image and saves it in space on the server. What I can't seem to think of is to say when the user downloads .png, by the time he saves on my server, I want it to be jpg.
Can someone help with this, and please do not just direct me to another question, as I have nothing working. Here is an example of my code.
$name = addslashes($_FILES['image']['name']); $ext = pathinfo($_FILES['image']['name'], PATHINFO_EXTENSION); $size = $_FILES['image']['size']; $temp = $_FILES ['image']['tmp_name']; $error = $_FILES ['image']['error']; if ($error > 0) die("Error uploading file! Code $error."); else if ($password == "" || $size > 2000000) { move_uploaded_file($temp, $images.$name); mysql_query("INSERT INTO image_approval VALUES ('','$description','','$images$name','',NOW())"); echo "Upload complete!"; }else{ echo "Error uploading file"; }
source share