Fix line-end detection for binary streams upload (branch 3).