Can you please let me know how I can rename and change extension an image file on loading to the server?
What I would to do is changing selected image extension to .jpg
(from .png or .JPEG) and hard code the name like new-image-1
for now what I have is this which exactly upload the image file as original name and extension.
$sourcePath = $_FILES['file']['tmp_name'];
$targetPath = "../uploads/".$_FILES['file']['name'];
move_uploaded_file($sourcePath,$targetPath) ;