Example #1
0
 public static function copy(File $file)
 {
     $path = $file->getPathname();
     $uploadPath = static::getDefaultUploadBasePath();
     if (!file_exists($path)) {
         return false;
     }
     copy($path, $uploadPath . DIRECTORY_SEPARATOR . basename($path));
     return new static(basename($path));
 }