L_InetFtpGetFile

#include "ltweb.h"

L_LTWEB_API L_INT L_InetFtpGetFile(hFtp, pszRemote, pszLocal, bOverwrite, uSendAs)

HFTP hFtp;

/* handle to an FTP connection */

L_TCHAR *pszRemote;

/* name of the file to retrieve */

L_TCHAR *pszLocal;

/* name of the file to create */

L_BOOL bOverwrite;

/* flag */

L_UINT uSendAs;

/* flag */

Retrieves a file from the FTP server and stores it under the specified file name, locally.

Parameter

Description

hFtp

Valid HFTP handle to an FTP connection.

pszRemote

Character string that contains the name of the file to retrieve from the FTP server. This is a NULL-terminated string.

pszLocal

Character string that contains the name of the file to create on the local system. This is a NULL-terminated string.

bOverwrite

Boolean flag that indicates whether the function should proceed if a local file of the specified name already exists. Possible values are:

 

Value

Meaning

 

TRUE

The local file will be overwritten.

 

FALSE

If the file already exists locally, then do not store the file locally.

uSendAs

Flag that indicates the conditions under which the transfers occur. Possible values are:

 

Value

Meaning

 

SENDAS_ASCII

Transfers the file as ASCII

 

SENDAS_BINARY

Transfers the file as BINARY

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

Retrieves a file from the FTP server and stores it under the specified file name locally.

Required DLLs and Libraries

LTWEB
LTFIL

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application

See Also

Functions:

L_InetFtpSendFile, L_InetFtpRenameFile, L_InetFtpDeleteFile

Topics:

FTP Functions: File Manipulation and Sending Bitmaps Over an FTP Connection

 

How to Program with FTP Functions

Example

For an example, refer to L_InetFtpConnect example.