code: public function addFile($hash, $url, $type = '', $size = 0)
      {
          // 后缀
          $arr = explode('.', $url);
          $ext = end($arr);
          
          // 类型
          $type || $type = $this->getUploadDriver()->getFileType($ext);
          
          // 大小
          $size || $size = FileInfo::getFileSize($url);
          
          $data = array(
              'file_hash' => $hash,
              'file_type' => $type,
              'file_ext' => $ext,
              'file_size' => $size,
              'file_url' => $url,
              'create_time' => time()
          );
          return $this->model->insert($data);
      }
docs: 保存文件
  
  @param unknown $hash
  @param unknown $url
  @param string $type
  @param number $size
  @return number