|
-
March 8th, 2006, 03:44 AM
#1
FtpGetFile() fails!
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);
-
March 8th, 2006, 03:46 AM
#2
Re: FtpGetFile() fails!
I got the InternetGetLastResponseInfo(). But the buffer it returns is empty.
With Regards,
A.Ilamparithi.
-
March 8th, 2006, 04:09 AM
#3
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|