diff --git a/cpp/example_code/s3/s3_getting_started_scenario.cpp b/cpp/example_code/s3/s3_getting_started_scenario.cpp index 3f9866ce855..58c56b81a28 100644 --- a/cpp/example_code/s3/s3_getting_started_scenario.cpp +++ b/cpp/example_code/s3/s3_getting_started_scenario.cpp @@ -168,7 +168,7 @@ bool AwsDoc::S3::S3_GettingStartedScenario(const Aws::String &uploadFilePath, co Aws::IOStream &ioStream = outcome.GetResultWithOwnership(). GetBody(); - Aws::OFStream outStream(saveFilePath); + Aws::OFStream outStream(saveFilePath, std::ios_base::out | std::ios_base::binary); if (!outStream.is_open()) { std::cout << "Error: unable to open file, '" << saveFilePath << "'." << std::endl; }