public function putFile($upToken, $key, $filePath, $params = null, $mime = 'application/octet-stream', $checkCrc = false)
{
$file = fopen($filePath, 'rb');
if ($file === false) {
throw new \Exception("file can not open", 1);
}
$params = self::trimParams($params);
$stat = fstat($file);
$size = $stat['size'];
if ($size <= Config::BLOCK_SIZE) {
$data = fread($file, $size);
fclose($file);
if ($data === false) {
throw new \Exception("file can not read", 1);
}
return FormUploader::put($upToken, $key, $data, $this->config, $params, $mime, $checkCrc);
}
$up = new ResumeUploader($upToken, $key, $file, $size, $params, $mime, $this->config);
$ret = $up->upload();
fclose($file);
return $ret;
}