PHP code example of moonamiamj / cospackage
1. Go to this page and download the library: Download moonamiamj/cospackage library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
moonamiamj / cospackage example snippets
composer
Cospackage::uploadFile($file->getPathname(), 'jpg');
Cospackage::uploadFile($file->getPathname(), 'jpg');//cos文件上传工作
Cospackage::getResource($url)//获取文件资源
Cospackage::getUploadSign($fileType = "image", $method = "post")//获取cos签名
Cospackage::getUploadParam($key)//获取文件上传参数 key:定义的文件目录名称或mercharID(生成目录)