the problem was writing a file in text mode instead of in binary mode.
Attach a file by drag & drop or click to upload