public function upload(File $tmpFile)
{
$clusterFileName = $this->_generateClusterFileName($tmpFile);
$dir = $this->rootBasePath;
$localPath = $this->getClusterDir($clusterFileName);
$clusterFileSrc = $clusterFileName;
if ($localPath) {
$clusterFileSrc = $localPath . DIRECTORY_SEPARATOR . $clusterFileSrc;
}
try {
$dir = new Dir($dir . DIRECTORY_SEPARATOR . $localPath);
$resultFile = $dir->newFile($clusterFileName);
$tmpFile->move($resultFile);
} catch (Exception $e) {
throw new Exception($e->getMessage());
}
return $clusterFileSrc;
}