作者 lyh

gx

... ... @@ -52,7 +52,7 @@ class ProductFileUpload extends Command
if($fileInfo === false){
continue;
}
$newName = preg_replace('#/[^/]*$#', '/', $url).$fileInfo['name'];
$newName = $fileInfo['name'];
$this->synchronizationFile($url,$newName);
$v['files']['url'] = $newName;
$productModel->edit(['files'=>json_encode($v['files'])],['id'=>$v['id']]);
... ... @@ -71,7 +71,8 @@ class ProductFileUpload extends Command
public function synchronizationFile($path_name,$newName){
//同步到大文件
$file_path = config('filesystems.disks.cos')['cdn1'].$path_name;
$cmd = 'curl -F "file_path='.$file_path.'" -F "save_path=/www/wwwroot/cos'.$newName.'" https://v6-file.globalso.com/upload.php';
$directoryPath = pathinfo($path_name, PATHINFO_DIRNAME);
$cmd = 'curl -F "file_path='.$file_path.'" -F "save_path=/www/wwwroot/cos'.$directoryPath.'" -F "file_name='.$newName.'" https://v6-file.globalso.com/fileUpload.php';
return shell_exec($cmd);
}
}
... ...