public static function extractFilename($string) {
    if (mb_strlen($string) == 0) 
      throw new Exception('Cannot extract filename from empty string');
    
    $file = basename($string);

    if (mb_strlen($file) == 0) 
      throw new Exception('PHP could not extract the basename of the file: '.$file);
    
    return $file;
  }