minio-cpp icon indicating copy to clipboard operation
minio-cpp copied to clipboard

On Windows, UploadObject throws exception when trying to upload a binary file

Open fwosar opened this issue 8 months ago • 2 comments

The fix is to explicitly pass in std::ios::binary when opening the file stream. On Windows using a clang toolchain and libc++, trying to upload a binary file without the flag set will result in a rather cryptic exception:

libc++abi: terminating due to uncaught exception of type std::__1::ios_base::failure: ios_base::clear: unspecified iostream_category error

It may be a good idea to add some binary files to the automated tests instead of only text files as well. ;)

fwosar avatar Jun 21 '24 18:06 fwosar