Error in CInternetFile CFtpConnetion->OpenFile(.....)
-
I am trying to upload one directory to the perticular server I have written the code as CInternetFile *pInternetFile = 0; pInternetFile = pFtpConnection->OpenFile(strDestFilePath, GENERIC_WRITE, FTP_TRANSFER_TYPE_BINARY, FtpConnection->GetContext()); CFile LocalFile; LocalFile.Open(strSrcFilePth, CFile::modeRead); TCHAR szBuffer[256] = ""; int iRC = 0; while((iRC = LocalFile.Read(static_cast(szBuffer), sizeof(szBuffer))) != 0) { // Write to file pInternetFile->Write(static_cast(szBuffer), iRC) ; m_lDestFileSize = m_lDestFileSize + sizeof(szBuffer); // Clear buffer memset(szBuffer, 0, sizeof(szBuffer)); } This code works for only one file and fails for second. Please help me go this. Thank you
-
I am trying to upload one directory to the perticular server I have written the code as CInternetFile *pInternetFile = 0; pInternetFile = pFtpConnection->OpenFile(strDestFilePath, GENERIC_WRITE, FTP_TRANSFER_TYPE_BINARY, FtpConnection->GetContext()); CFile LocalFile; LocalFile.Open(strSrcFilePth, CFile::modeRead); TCHAR szBuffer[256] = ""; int iRC = 0; while((iRC = LocalFile.Read(static_cast(szBuffer), sizeof(szBuffer))) != 0) { // Write to file pInternetFile->Write(static_cast(szBuffer), iRC) ; m_lDestFileSize = m_lDestFileSize + sizeof(szBuffer); // Clear buffer memset(szBuffer, 0, sizeof(szBuffer)); } This code works for only one file and fails for second. Please help me go this. Thank you
-
I am trying to upload one directory to the perticular server I have written the code as CInternetFile *pInternetFile = 0; pInternetFile = pFtpConnection->OpenFile(strDestFilePath, GENERIC_WRITE, FTP_TRANSFER_TYPE_BINARY, FtpConnection->GetContext()); CFile LocalFile; LocalFile.Open(strSrcFilePth, CFile::modeRead); TCHAR szBuffer[256] = ""; int iRC = 0; while((iRC = LocalFile.Read(static_cast(szBuffer), sizeof(szBuffer))) != 0) { // Write to file pInternetFile->Write(static_cast(szBuffer), iRC) ; m_lDestFileSize = m_lDestFileSize + sizeof(szBuffer); // Clear buffer memset(szBuffer, 0, sizeof(szBuffer)); } This code works for only one file and fails for second. Please help me go this. Thank you
Which line has the error?