Closed tooyamk closed 5 years ago
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_shared(buf); AlibabaCloud::OSS::PutObjectRequest request(BucketName, Key, content); client.PutObject(request);
返回的信息是code:ParseXMLError,msg:XML_ERROR_MISMATCHED_ELEMENT
我尝试直接用stringstream上传字符串是正常的,但是不知道这个二进制上传哪里出的问题
你可以参考一下 https://github.com/aliyun/aliyun-oss-cpp-sdk/issues/12
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_shared(buf);
AlibabaCloud::OSS::PutObjectRequest request(BucketName, Key, content);
client.PutObject(request);
返回的信息是code:ParseXMLError,msg:XML_ERROR_MISMATCHED_ELEMENT
我尝试直接用stringstream上传字符串是正常的,但是不知道这个二进制上传哪里出的问题