正在显示
1 个修改的文件
包含
4 行增加
和
1 行删除
| @@ -44,15 +44,18 @@ class TencentCosService extends BaseService | @@ -44,15 +44,18 @@ class TencentCosService extends BaseService | ||
| 44 | // 构造请求方法、URL和头部 | 44 | // 构造请求方法、URL和头部 |
| 45 | $url = 'https://' . $this->config['bucket'] . '.cos.' . $this->config['cosRegion'] . '.myqcloud.com'.$path; | 45 | $url = 'https://' . $this->config['bucket'] . '.cos.' . $this->config['cosRegion'] . '.myqcloud.com'.$path; |
| 46 | var_dump($url); | 46 | var_dump($url); |
| 47 | - die(); | ||
| 48 | $this->method = 'PUT'; | 47 | $this->method = 'PUT'; |
| 49 | $headers = array( | 48 | $headers = array( |
| 50 | 'Authorization: ' . $this->cosAuthorization($this->config['appId'], $this->config['secretId'], $this->config['secretKey'], $this->method, '/' . $this->config['bucket'] . $path), | 49 | 'Authorization: ' . $this->cosAuthorization($this->config['appId'], $this->config['secretId'], $this->config['secretKey'], $this->method, '/' . $this->config['bucket'] . $path), |
| 51 | 'Content-Type: image/'.$image_type // 根据上传的文件类型设置相应的Content-Type | 50 | 'Content-Type: image/'.$image_type // 根据上传的文件类型设置相应的Content-Type |
| 52 | ); | 51 | ); |
| 52 | + var_dump($headers); | ||
| 53 | // 打开文件流 | 53 | // 打开文件流 |
| 54 | $url_path = config('filesystems.disks.upload')['root'].$path; | 54 | $url_path = config('filesystems.disks.upload')['root'].$path; |
| 55 | + var_dump($url_path); | ||
| 55 | $file = fopen($url_path, 'r'); | 56 | $file = fopen($url_path, 'r'); |
| 57 | + var_dump($file); | ||
| 58 | + die(); | ||
| 56 | return $this->http_put($url,$headers,$file,$url_path); | 59 | return $this->http_put($url,$headers,$file,$url_path); |
| 57 | } | 60 | } |
| 58 | 61 |
-
请 注册 或 登录 后发表评论