MultipartUpload with Presigned URLs to upload parts #2393
-
Hello, The problem is that I have no idea how to generate the predefined URLs. The GeneratePresignedUrl method of the S3Client has the signature
I can't find any example or documentation on this problem related to the C++ SDK - just a tutorial (https://www.altostra.com/blog/multipart-uploads-with-s3-presigned-url), but with a different programming language and I can't apply it to my project. Hopefully someone can give me a hint! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
OK, I've found a (hidden) GeneratePresignedUrl Method in AWSClient I could use: But I don't know which value I have to use for 'url' - my environment is dynamically. Is it possible to get the url from my S3Client instance? |
Beta Was this translation helpful? Give feedback.
-
Ok - I solved my problem by generating the resulting URL myself. I found the "computeEndpointString" method in the S3Client implementation - but it's private, so I re-implemented it myself. // generate URI to object (http(s)://bucket.region/uploadName or http(s)://endpointOverwrite.../uploadName auto presignedUrl = s3Client->Aws::Client::AWSClient::GeneratePresignedUrl( |
Beta Was this translation helpful? Give feedback.
-
Hello! Reopening this discussion to make it searchable. |
Beta Was this translation helpful? Give feedback.
Ok - I solved my problem by generating the resulting URL myself. I found the "computeEndpointString" method in the S3Client implementation - but it's private, so I re-implemented it myself.
With the computed endpoint string, it was easy to generate the predefined URL using the GeneratePresignedUrl method from AwsClient (NOT S3Client - the methods from S3Client hide the methods from AWSClient).
Maybe this snippet will help someone else:
`
Aws::S3::Model::UploadPartRequest uploadRequest;
uploadRequest.SetBucket(myBucket);
uploadRequest.SetKey(uploadName);
uploadRequest.SetUploadId(myUploadID);
uploadRequest.SetPartNumber(currentPartNumber);
// generate URI to object (http(s)://bucket.region…