Find File Extension Script

Find File Extension Script is use to when you upload the file to server get and display the file types to user.

Demo :


Example :

Just click Browse... button then select image or any one file and click Upload button then file type will be display below of upload form.

Code :

Following code is used to find the file types if you need to copy and use to your website.

function find_file_type($file)
    return $file_type=".gif";
  else if(($file=="image/pjpeg") || ($file == "image/jpeg") || ($file== "image/jpg"))
    return $file_type=".jpg";
  else if(($file == "image/x-png") || ($file=="image/png"))
    return $file_type=".png";
    $file_type = explode('.',$file);
    return '.'.$file_type[1];

$file = "Filename";
echo 'This is '.find_file_type($file).' File Format';

In the above find_file_type() function have in one argument that is file name.If you pass the file name to this function finally return the which file format. $file variable will use to assign the file.

Free Download Script :

If you need Find File Extension Script click and download from following link.