thinkphp5计算文件大小

function file_sizes($path){

	if(empty($path)){

		return 0;

	}

	  $path = ROOT_PATH . ‘public/static/index/uploads/att/‘.$path;

	// $path="/public/static/index/uploads/att/2021060398605bd7fa1311afaaa2acc4bf07bf74.pptx";

	 $path=str_replace("\","/", $path);

	 // $fCont = file_get_contents($path);   

     // return strlen($fCont)/1024;  

//echo $path;exit;

	if (file_exists($path)){

		return round(filesize($path)/1024,2);

	}else{

		return 0;		

	}

}
thinkphp5计算文件大小

 

 

  

thinkphp5计算文件大小

上一篇:js,jq当中dom操作


下一篇:webpack相关