作者 lyh

gx

@@ -147,7 +147,14 @@ class FileController @@ -147,7 +147,14 @@ class FileController
147 */ 147 */
148 public function synchronizationFile($fileName,$location){ 148 public function synchronizationFile($fileName,$location){
149 //同步到大文件 149 //同步到大文件
150 - SyncImageFileJob::dispatch(['path'=>$this->path,'name'=>$fileName,'location'=>$location]); 150 + $file_path = $this->getUrl($this->path.'/'.$fileName, 0,$location);
  151 + $headers = get_headers($file_path, 1);
  152 + if (strpos($headers[0], '200') === false) {
  153 + $errorFileModel = new ErrorFile();
  154 + $errorFileModel->add(['path'=>$this->param['path'].'/'.$this->param['name']]);
  155 + }else{
  156 + SyncImageFileJob::dispatch(['path'=>$this->path,'name'=>$fileName,'location'=>$location]);
  157 + }
151 return true; 158 return true;
152 } 159 }
153 160