setApiUri($easemob['api_uri']); } // 实例化对象 $attachment = new Attachment($auth); echo '
'; /* // 上传文件 $data = $attachment->uploadFile('images/1.png'); var_dump($data); // array(3) { // ["uuid"]=> // string(36) "a4364f90-b0d8-11ec-8cfe-b57d5aca4e63" // ["type"]=> // string(8) "chatfile" // ["share-secret"]=> // string(48) "pDZPmrDYEeyGTyPdhVc_kj_MzWvSzIfi3bg_fgkvpVjvQAo5" // } $data = $attachment->uploadFile('/usr/share/nginx/html/sdk.com/examples/images/1.png', true); var_dump($data); // array(3) { // ["uuid"]=> // string(36) "a4615730-b0d8-11ec-92b5-1fe1ed287b6a" // ["type"]=> // string(8) "chatfile" // ["share-secret"]=> // string(48) "pGF-QLDYEeyPS6lef7QYBPQMYwHMCVRt34DkF3KYLMETh4s0" // } */ /* // 下载文件 var_dump($attachment->downloadFile('images/11.png', 'a4364f90-b0d8-11ec-8cfe-b57d5aca4e63')); // 下载文件 var_dump($attachment->downloadFile('images/111/22.png', 'a4615730-b0d8-11ec-92b5-1fe1ed287b6a', 'pGF-QLDYEeyPS6lef7QYBPQMYwHMCVRt34DkF3KYLMETh4s0')); */ /* // 下载缩略图 var_dump($attachment->downloadThumb('images/11_thumb.png', 'a4364f90-b0d8-11ec-8cfe-b57d5aca4e63')); var_dump($attachment->downloadThumb('images/111/11_thumb.png', 'a4615730-b0d8-11ec-92b5-1fe1ed287b6a', 'pGF-QLDYEeyPS6lef7QYBPQMYwHMCVRt34DkF3KYLMETh4s0')); */