shared_ptr<S3Client> m_shared_client;
Aws::SDKOptions m_options;
S3_Sample::S3_Sample()
{
Aws::InitAPI(m_options);
Aws::Client::ClientConfiguration cfg;
cfg.endpointOverride = "ip:port"; // S3服务器地址和端口
cfg.scheme = Aws::Http::Scheme::HTTP;
cfg.verifySSL = false;
Aws::Auth::AWSCredentials cred("xxxx", "yyyy");
m_shared_client = std::make_shared<S3Client>(cred, cfg, false, false);
}
S3_Sample::~S3_Sample()
{
Aws::ShutdownAPI(m_options);
}
bool S3_Sample::upload_file(std::string BucketName, std::string objectKey, std::string pathkey)
{
auto pCient = m_shared_client;
PutObjectRequest putObjectRequest;
putObjectRequest.WithBucket(BucketName.c_str()).WithKey(objectKey.c_str());
auto input_data = Aws::MakeShar