Code:
BOOL CListfilesDlg::recursion(CString sPath)
{
HANDLE hFind;
WIN32_FIND_DATA fdFind;
UpdateData(true);
CString StrPathS = m_editvalue;
CString salvation = StrPathS + sPath;
UpdateData(false);
CString ren = salvation + "\\*.*";
hFind = FindFirstFile( ren, &fdFind );
do{
if( fdFind.dwFileAttributes == FILE_ATTRIBUTE_DIRECTORY)
{
if(IsDots(fdFind.cFileName)) continue; // skip . and ..
UpdateData(true);
CString cov = sPath;
CString fire = m_editvalue;
UpdateData(false);
CString newPath = cov + "\\" + fdFind.cFileName;
FtpCreateDirectory(hIConnect,fdFind.cFileName);
recursion(newPath);
}
if(fdFind.dwFileAttributes == FILE_ATTRIBUTE_ARCHIVE)
continue;
else
{
}
}while( FindNextFile( hFind, &fdFind ) );
return 0;
}
The code above will take a directory and rip out all the sub directory and put them in the same directory. how can I upload a directory with all its contents inside.? the code above is what I got so far. can someone help out as ihave been trying to get this work..even tried debugging..but no luck