Re scpsftp with binary model
To detect line endings used by a file on Windows, use following command on PowerShell console to display hex dump of the first characters of given file example. If you do not have a shell access to the remote system, download the file using binary encoding and use the PowerShell command on a local binary-identical copy. Use these techniques to detect, what format both source and destination files have. When editing a file, detect also a format of a local temporary copy of the edited file as saved by the editor.
See preferences for a location of the temporary copies. When the above does not help you understand the problem and you decide to seek support , include all your findings, including copies of both source and destination file.
When editing a file, include also a local temporary copy as saved by the editor. Ideally compress ZIP the files to avoid your browser altering file format, when attaching the files to support request. WinSCP internal editor does not support Unix file format.
Back Most text editors nowadays support different text file formats, not just a format native to the platform the editor runs on. Back Alternatives are hexdump example. You can modify the mask as you need.
Files not matching the mask are transferred using Binary mode. There are two options how to support text mode transfers. The first option is that the client WinSCP knows directly the text file format used by the server and converts the file to the format before transfer. The second option is that there is some in advance agreed canonical format to which the client converts the file before transfer and from which the server converts it if necessary after transfer to its own format.
It this case the client WinSCP must directly know and support the server-side format. Generally there are plenty of text file formats, almost every platform has it own format. You can select between them on Environment page of Advanced Site Settings dialog. WebDAV and S3 protocols do not allow selecting transfer mode. The transfer mode is set as part of transfer settings. Note that there are two predefined transfer settings presets , Text and Binary that may help you switching the mode.
To configure transfer mode in scripting , use -transfer switch of file transfer commands. NET assembly use TransferOptions.