typecho-plugin-ossfile
typecho-plugin-ossfile copied to clipboard
增加 byte 流写入内容的考虑
增加 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'])