Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion: Use std::ios::binary flag when opening files for upload #174

Closed
HMS-Yukikaze opened this issue Sep 9, 2024 · 1 comment
Closed

Comments

@HMS-Yukikaze
Copy link

https://github.com/mrjimenez/pupnp-backup/blob/c61460be44645f5c9040c1cf4cf7ac5efbe6b01d/cmake/CmDaB.cmake#L43
I encountered an issue when using the library for file uploads.

Description

The file is currently opened using file.open(args.filename);, which does not include the std::ios::binary flag.
This causes problems when uploading non-text files (e.g., binary files like images or executables).
To properly handle these types of files, it is recommended to open the file using file.open(args.filename, std::ios::binary);

Steps to Reproduce:

  1. up an *.psd file to the oss sever
  2. error in line:https://github.com/minio/minio-cpp/blob/40824d0872861b06965a032a714a8f4f9097fb32/src/utils.cc#L601
    OS: Windows 11 22631.4037
    Compiler:MSVC 2019 X64
@balamurugana
Copy link
Member

Duplicate #145

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants