Back to product page

TransferMode function


Determines if transfers are Binary or AscII.

Type

A Long value. If successful, 0 is returned, otherwise error as specified here

Syntax

  • C
long Sftp_GetTransferMode(void *Sftp, TransferModesEnum *pVal);
long Sftp_SetTransferMode(void *Sftp, TransferModesEnum newVal);
The TransferMode(void *Sftp,TransferModesEnum *pVal, newVal) syntax has these parts:
void *SftpHandle of the created Sftp instance.
TransferModesEnum *pVal, newValA TransferModesEnum enumeration, as described in settings.

Remarks

The settings for value are:

Constant Value Description
Binary0 Data is transmitted "as-is".
AscII 1 CRLF conversions are performed.


The TransferMode function is a client-side add-on function (by default the SFTP protocol does not differentiate between ASCII and BINARY transfer modes) . When set to Binary, wodSFTP will not interfere with the file content sent or received from the server. However, if set to AscII then wodSFTP will perform CRLF -> LF translation before sending a file, and LF -> CRLF translation when receiving a file. As a result, ASCII files should be readable on both remote and local ends.


Progress callback will show false information regarding file size/position. It will show information which is valid for a file on the remote server, but when downloaded it can be much smaller (depending of number of LF's it contains).

Resume property can cause problems when used in ASCII mode because the effects of the translation will mean that the contents of one file at any given numerical position will no longer correspond to the contents of the opposite file at the same position

Platforms

Windows