...
|
...
|
@@ -327,7 +327,12 @@ class Upload |
|
|
$result = $storage->upload($arrInfo["file_path"], './upload/' . $arrInfo["file_path"], $fileType);
|
|
|
if (!empty($result)) {
|
|
|
//我加的
|
|
|
unlink('./upload/' . $arrInfo["file_path"]);
|
|
|
|
|
|
$sys = $this->getOperateSys();
|
|
|
if($sys == 'Linux'){
|
|
|
$file = ROOT_PATH.'/public/upload/' . $arrInfo["file_path"];
|
|
|
unlink($file);//适用于linux
|
|
|
}
|
|
|
return array_merge([
|
|
|
'filepath' => $arrInfo["file_path"],
|
|
|
"name" => $arrInfo["filename"],
|
...
|
...
|
@@ -361,4 +366,18 @@ class Upload |
|
|
];
|
|
|
}
|
|
|
|
|
|
//判断当前操作系统
|
|
|
private function getOperateSys(){
|
|
|
$os_name = php_uname('s');
|
|
|
//判断
|
|
|
if(strpos($os_name,"Linux")!==false){
|
|
|
$os_str="Linux";
|
|
|
}else if(strpos($os_name,"Windows")!==false){
|
|
|
$os_str="Windows";
|
|
|
}else{
|
|
|
$os_str='';
|
|
|
}
|
|
|
return $os_str;
|
|
|
}
|
|
|
|
|
|
} |
...
|
...
|
|