endpoint' => 'https://oss-cn-chengdu.aliyuncs.com',
// 'addressing_style' => 'virtual',
]);
```
## 1.2 服务器上传文件通常前端先上传到服务器,然后通过服务器再上传到OSS,即中传了一次。'/1.php'),
'ContentType' => 'text/plain',
]);
}
```
## 1.3 前端直传文件到OSS
### 1.3.1 服务器先生成签名表单' => 'https://xxx-yyy.cos.ap-chengdu.myqcloud.com',
'use_path_style_endpoint' => true,
]);
```
服务器上传文件同上阿里云## 2.2 前端直接上传文件
### 2.2.1 服务器先生成签名表单
```php
function buildForm(\Aws\S3\S3Client $s3client): array
{