wodSFTP API library - TransferMode Property
      
 

Description

Determines if transfers are Binary or AscII.


Return type

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


Syntax

long Sftp_GetTransferMode(void *Sftp, TransferModesEnum *pVal);
long Sftp_SetTransferMode(void *Sftp, TransferModesEnum newVal);

The TransferMode function syntax has these parts:

Part Description
void *Sftp Handle of the created Sftp instance.
TransferModesEnum *pVal, newVal A TransferModesEnum enumeration, as described in settings.

Settings

The settings for value are:

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

Remarks

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.

This function only makes sense if the remote system is running UNIX or a similar OS. If the server is Windows-based, you should not translate because both systems use the same sequences to mark EOL (end-of-line). However, UNIX systems don't use CRLF (carriage-return-line-feed) they only use LF (line-feed).

Please note that when receiving a file using ASCII mode, the 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).

The 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