Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

上传直接从内存创建的二进制文件出错 #51

Closed
tooyamk opened this issue Nov 1, 2019 · 1 comment
Closed

上传直接从内存创建的二进制文件出错 #51

tooyamk opened this issue Nov 1, 2019 · 1 comment

Comments

@tooyamk
Copy link

tooyamk commented Nov 1, 2019

class membuf : public std::streambuf {
public:
membuf(char* p, size_t n) {
setg(p, p, p + n);
}
};

auto buf = new membuf(new char[n], n);
auto content = std::make_sharedstd::iostream(buf);
AlibabaCloud::OSS::PutObjectRequest request(BucketName, Key, content);
client.PutObject(request);

返回的信息是code:ParseXMLError,msg:XML_ERROR_MISMATCHED_ELEMENT

我尝试直接用stringstream上传字符串是正常的,但是不知道这个二进制上传哪里出的问题

@huiguangjun
Copy link
Collaborator

你可以参考一下 #12

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

No branches or pull requests

2 participants