public static function makeSafe($file)
  {
    $regex = [ 
      '#(\.){2,}#', 
      '#[^A-Za-z0-9\.\_\- ]#', '#^\.#',
    ];
    
    $file = rtrim($file, '.');
    $clean = preg_replace($regex, ' ', $file);
    $clean = preg_replace("/[ \_]/", '-', $clean);
    $clean = preg_replace("/[\-]+/", '-', $clean);
    return $clean;
  }