Skip to content

Files are saved as folders containing xl.meta files #2561

@TheSharpOwl

Description

@TheSharpOwl

Describe the bug

When uploading a file (image png/jpg or json file) using a string stream, let's say sample.png I get a folder called sample.png and inside of it there is xl.meta file.

I tried to save the image locally and it was working totally okay so the encoder code is working. Also, I remember one year ago it was saving on minio container fine but now I cameback to the same exact code one year ago but still the issue arises.

Conditions:

  • Docker image for minio to connect to

Where it was tried:

  • Ubuntu 18
  • Windows 10

How it can be seen

  • Using a terminal and trying to cd the image name
  • Using volumes mounting

Expected Behavior

Get an image/json file not a folder

Current Behavior

I get a folder called sample.png and inside of it there is xl.meta file.

Reproduction Steps

// connect to a bucket using the examples then using this method:
bool saveData(const char *rawData,
                           size_t dataSize,
                           const std::string &filename) {
  Aws::S3::Model::PutObjectRequest putObjectRequest;
  putObjectRequest.WithBucket(bucketName_.c_str()).WithKey(filename.c_str());

  auto data = Aws::MakeShared<Aws::StringStream>(
      "PutObjectInputStream",
      std::stringstream::in | std::stringstream::out
          | std::stringstream::binary);

  data->write(rawData, dataSize);

  putObjectRequest.SetBody(data);
   // these lines were tried too and they didn't fix it
  // putObjectRequest.SetContentType("image/jpeg");
  // putObjectRequest.SetContentLength(dataSize);
  auto result = client_->PutObject(putObjectRequest);
  if (result.IsSuccess()) {
    return true;
  }
  return false;
}

Possible Solution

No response

Additional Information/Context

No response

AWS CPP SDK version used

1.11.65 (vcpkg)

Compiler and Version used

Visual Studio 2017 15.9.48 Community

Operating System and version

Windows 10 19044.3086

Metadata

Metadata

Assignees

Labels

guidanceQuestion that needs advice or information.p3This is a minor priority issuethird-partyThis issue is related to third-party libraries or applications.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions