Skip to content

Downloading objects with leading forward slash in key #3310

Answered by sbiscigl
aokhovat asked this question in Q&A
Discussion options

You must be logged in to vote

So this was originally was a issue with how the cpp handled path separators with S3, we could not change the default behavior to match cli/boto by default without breaking existing customers so we made it opt-in(#2891). you can opt in using

SetPreservePathSeparators(true);

a complete example would look like

#include <aws/core/Aws.h>
#include <aws/core/http/URI.h>
#include <aws/s3/S3Client.h>
#include <aws/s3/model/GetObjectRequest.h>

using namespace Aws;
using namespace Aws::Http;
using namespace Aws::S3;
using namespace Aws::S3::Model;

auto main() -> int {
  SDKOptions options{};
  InitAPI(options);
  {
    SetPreservePathSeparators(true);
    S3ClientConfiguration client_configuration…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@aokhovat
Comment options

Answer selected by aokhovat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants