...
|
...
|
@@ -326,6 +326,13 @@ class Upload |
|
|
session_write_close();
|
|
|
$result = $storage->upload($arrInfo["file_path"], './upload/' . $arrInfo["file_path"], $fileType);
|
|
|
if (!empty($result)) {
|
|
|
//我加的
|
|
|
$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"],
|
...
|
...
|
@@ -358,5 +365,18 @@ class Upload |
|
|
'url' => cmf_get_root() . '/upload/' . $arrInfo["file_path"],
|
|
|
];
|
|
|
}
|
|
|
//判断当前操作系统
|
|
|
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;
|
|
|
}
|
|
|
|
|
|
} |
...
|
...
|
|