This code will change file extension from uppercase to lowercase.
If there is a file called dog.JPG on my desktop, when I try to upload it fails. This script will convert it to a lowercase and upload it successfully.
Remember this is only part of the script
$arr_file_types = ['image/png', 'image/gif', 'image/jpg', 'image/jpeg'];
$_FILES['file']['name'] = strtolower($_FILES['file']['name']);
if (!(in_array($_FILES['file']['type'], $arr_file_types))) {
echo "false";
return;
}
move_uploaded_file($_FILES['file']['tmp_name'], 'reports/'. $clientname .'/' . $_FILES['file']['name']);
echo "success";











