Skip to content
This repository has been archived by the owner on Jul 6, 2022. It is now read-only.

增加 byte 流写入内容的考虑 #6

Open
kraity opened this issue Aug 18, 2019 · 1 comment
Open

增加 byte 流写入内容的考虑 #6

kraity opened this issue Aug 18, 2019 · 1 comment

Comments

@kraity
Copy link

kraity commented Aug 18, 2019

增加 byte 流写入内容的考虑
用于XMLRPC接口上传附件因为XMLRPC上传用的byte流写入数据

152行

$result = $ossClient->uploadFile($options->bucket, substr($path,1), $uploadfile);

改为

if (isset($file['tmp_name'])) {
                $result = $ossClient->uploadFile($options->bucket, substr($path, 1), $uploadfile);
            } else {
                $result = $ossClient->putObject($options->bucket, substr($path, 1), $uploadfile);
            }

169行

'mime' => @Typecho_Common::mimeContentType($path)

其改为

'mime' => (isset($file['tmp_name']) ? Typecho_Common::mimeContentType($file['tmp_name']) : $file['mime'])
@jzwalk
Copy link

jzwalk commented Jun 27, 2020

Typecho Fans社区版已代更

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants