public function generatePath($fileName, $createDir = false, $uploadRootPath = './', $level = 3)
{
$level = $level > 6 ? 6 : $level;
$array = str_split(md5($fileName), 4);
$path = '';
$arraySliced = array_slice($array, 0, $level);
foreach ($arraySliced as $item) {
$path .= $item . '/';
$createDir && !file_exists($uploadRootPath . $path) && mkdir($uploadRootPath . $path);
}
return $path;
}