Closed dingbaiyin closed 2 years ago
error: "PutObject fail, code: InvalidObjectName, message: The specified object is not valid, requestId: 62C3A7CD7FFDC23339E1A234"
` std::string BucketName = "bdh-dev"; /* 填写Object完整路径,完整路径中不能包含Bucket名称,例如exampledir/exampleobject.txt。*/ std::string ObjectName = "/home/pi/Pictures/abc.jpg"; //这里是在oss的文件名 InitializeSdk(); ClientConfiguration conf; OssClient client(Endpoint,AccessKeyId, AccessKeySecret, conf); std::shared_ptr<std::iostream> content = std::make_shared<std::stringstream>(); *content << "Thank you for using Alibaba Cloud Object Storage Service!"; PutObjectRequest request(BucketName, ObjectName, content); /* 上传文件 */ auto outcome = client.PutObject(request); if (!outcome.isSuccess()) { /* 异常处理。*/ std::cout << "PutObject fail" << ",code:" << outcome.error().Code() << ",message:" << outcome.error().Message() << ",requestId:" << outcome.error().RequestId() << std::endl; ShutdownSdk(); return -1; } /* 释放网络等资源。*/ ShutdownSdk(); `
I checked the error message document as shown below, there is no problem with the image naming format, and I converted the image format to UTF-8, but still reported an error。I don't know what the problem is and how to solve it, please help me
error: "PutObject fail, code: InvalidObjectName, message: The specified object is not valid, requestId: 62C3A7CD7FFDC23339E1A234"
I checked the error message document as shown below, there is no problem with the image naming format, and I converted the image format to UTF-8, but still reported an error。I don't know what the problem is and how to solve it, please help me