private static function isFileValid($filename, $mimeType, $allowedExts, $allowedMimeTypes) {
    // Skip if the allowed extensions or mime types are missing.
    if (!$allowedExts || !$allowedMimeTypes) {
      return false;
    }

    // Get extension.
    $extension = end($filename);

    return in_array(strtolower($mimeType), $allowedMimeTypes) && in_array(strtolower($extension), $allowedExts, true);
  }
private static function isFileValid($filename, $mimeType, $allowedExts, $allowedMimeTypes) {
    // Skip if the allowed extensions or mime types are missing.
    if (!$allowedExts || !$allowedMimeTypes) {
      return false;
    }

    // Get extension.
    $extension = end($filename);

    return in_array(strtolower($mimeType), $allowedMimeTypes) && in_array(strtolower($extension), $allowedExts, true);
  }
private static function isFileValid ( $ filename , $ mimeType , $ allowedExts , $ allowedMimeTypes ) { // Skip if the allowed extensions or mime types are missing. if ( ! $ allowedExts || ! $ allowedMimeTypes ) { return false ; } // Get extension. $ extension = end ( $ filename ) ; return in_array ( strtolower ( $ mimeType ) , $ allowedMimeTypes ) && in_array ( strtolower ( $ extension ) , $ allowedExts , true ) ; }
Check if file is matching the specified allowed extensions and mime types.

@param $filename array
@param $mimeType string
@param $allowedExts array
@param $allowedMimeTypes array

@return boolean
Check if file is matching the specified allowed extensions and mime types .