作者 lyh

gx

... ... @@ -4,6 +4,7 @@ namespace App\Http\Controllers\File;
use App\Enums\Common\Code;
use App\Helper\Translate;
use App\Jobs\SyncImageFileJob;
use App\Models\File\ErrorFile;
use App\Models\File\File;
use App\Models\File\Image as ImageModel;
... ... @@ -146,13 +147,7 @@ class FileController
*/
public function synchronizationFile($fileName){
//同步到大文件
$file_path = config('filesystems.disks.cos')['cdn1'].$this->path.'/'.$fileName;
$cmd = 'curl -F "file_path='.$file_path.'" -F "save_path=/www/wwwroot/cos'.$this->path.'" https://v6-file.globalso.com/upload.php';
$code = shell_exec($cmd);
if(200 != (int)$code){
$errorFileModel = new ErrorFile();
$errorFileModel->add(['path'=>$this->path.'/'.$fileName]);
}
SyncImageFileJob::dispatch(['path'=>$this->path,'name'=>$fileName]);
return true;
}
... ...