Can We find out the extension of the original file from $_FILES["file"]["tmp_name"] ? For example jpg or png etc?
$_FILES["file"]["tmp_name"]
Yes you can use $_FILES['file']['name'] to get the original name of the uploaded file. Just keep in mind that the extension may not always represent the real contents of the file.
$_FILES['file']['name']