Hi All,

My call to FtpGetFile fails, return an error code of 12003.

Any help would be appreciated.

With Regards,
A.Ilamparithi.


HINTERNET hInternetSession;
HINTERNET hFTPSession;
HINTERNET hFileConnection;
BOOL bResult = TRUE;
hInternetSession = ::InternetOpen(

"Microsoft Internet Explorer", // agent

INTERNET_OPEN_TYPE_PROXY, // access

"ftp-gw", // proxy server

NULL, // defaults

0); // synchronous



hFTPSession = ConnectToFtpServer(hInternetSession,
"ftp.microsoft.com"
NULL, // Use anonymous username
NULL, // Use e-mail name password
(LPVOID)&dwContext);

// find first .ZIP file
hFileConnection = ::FtpFindFirstFile(
hFTPSession,
"*.ZIP",
&sWFD,
0,
0);
if (hFileConnection != (HINTERNET)NULL)
{
::FtpSetCurrentDirectory(hFTPSession, "/BIN");

while (bResult)
{
// Create file specs.
InputSpec = "ftp://ftp.infosite.com/BIN/";
InputSpec = InputSpec + sWFD.cFileName;
OutputSpec = "c:\zipfiles\";
OutputSpec = OutputSpec + sWFD.cFileName;

// Transfer the file.
bResult = ::FtpGetFile(
hFTPSession,
InputSpec,
OutputSpec,
FALSE,
FILE_ATTRIBUTE_NORMAL,
FTP_TRANSFER_TYPE_BINARY,
0);


// Get next file.
bResult = ::InternetFindNextFile(
hFileConnection,
&sWFD);
}
}
// Close down all connections.
::InternetCloseHandle(hFTPSession);
::InternetCloseHandle(hInternetSession);