合并分支 'akun' 到 'master'
update 查看合并请求 !47
正在显示
1 个修改的文件
包含
13 行增加
和
1 行删除
| @@ -93,11 +93,23 @@ class CosService | @@ -93,11 +93,23 @@ class CosService | ||
| 93 | 'secretKey' => $cos['credentials']['secretKey'], | 93 | 'secretKey' => $cos['credentials']['secretKey'], |
| 94 | ], | 94 | ], |
| 95 | ]); | 95 | ]); |
| 96 | + | ||
| 97 | + $opts = [ | ||
| 98 | + 'http' => [ | ||
| 99 | + 'header' => 'User-Agent:Mozilla/5.0 (Windows NT 6.2; WOW64; rv:32.0) Gecko/20100101 Firefox/32.0' | ||
| 100 | + ], | ||
| 101 | + 'ssl' => [ | ||
| 102 | + 'verify_peer' => false, | ||
| 103 | + 'verify_peer_name' => false, | ||
| 104 | + ] | ||
| 105 | + ]; | ||
| 106 | + $body = file_get_contents($file_url,false,stream_context_create($opts)); | ||
| 107 | + | ||
| 96 | try { | 108 | try { |
| 97 | $cosClient->putObject([ | 109 | $cosClient->putObject([ |
| 98 | 'Bucket' => $cos['bucket'], | 110 | 'Bucket' => $cos['bucket'], |
| 99 | 'Key' => $key, | 111 | 'Key' => $key, |
| 100 | - 'Body' => fopen($file_url, 'r'), | 112 | + 'Body' => $body, |
| 101 | ]); | 113 | ]); |
| 102 | return $key; | 114 | return $key; |
| 103 | }catch (\Exception $e){ | 115 | }catch (\Exception $e){ |
-
请 注册 或 登录 后发表评论