aliyun / aliyun-oss-cpp-sdk

Aliyun OSS SDK for C++
Other
188 stars 88 forks source link

how to download a picture from OSS to memory #62

Closed wuyuewei closed 4 years ago

wuyuewei commented 4 years ago

GetObjectRequest request(BucketName, ObjectName); auto outcome = client.GetObject(request); if (outcome.isSuccess()) {
std::cout << "getObjectToBuffer" << " success, Content-Length:" << outcome.result().Metadata().ContentLength() << std::endl; /打印下载内容/ std::string content; *(outcome.result().Content()) >> content; std::cout << "getObjectToBuffer" << "content:" << content << std::endl; }

this example only suit to files,but how to download a pic into memory?

hanqingwu commented 4 years ago
    char ch[100];
    *(object.result().Content()) >> ch;
wuyuewei commented 4 years ago

thank you