Fix line-end detection for binary streams upload

- Related: #1017 (and #1016)