typecho-plugin-ossfile icon indicating copy to clipboard operation
typecho-plugin-ossfile copied to clipboard

增加 byte 流写入内容的考虑

Open kraity opened this issue 5 years ago • 1 comments

增加 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'])

kraity avatar Aug 18 '19 03:08 kraity

Typecho Fans社区版已代更

jzwalk avatar Jun 27 '20 02:06 jzwalk