void CUploadFilesDlg::OnUploadFiles() { CFtpConnection *m_pFtpConnection; CInternetSession m_Session; m_pFtpConnection = NULL; try { m_pFtpConnection = m_Session.GetFtpConnection(_T("filegenie.com"), _T("rezaeefatima"),_T("2502-DRMB"),INTERNET_INVALID_PORT_NUMBER); } catch(CInternetException *pEx) { pEx->ReportError(MB_ICONEXCLAMATION); m_pFtpConnection = NULL; pEx->Delete(); } CFileFind Finder; CString strFileName; ULONG len; if(Finder.FindFile(m_txtFileName)==TRUE) { Finder.FindNextFile(); strFileName = Finder.GetFileName(); len = Finder.GetLength(); Finder.Close(); } BOOL bUploaded = m_pFtpConnection->PutFile(m_txtFileName, strFileName,FTP_TRANSFER_TYPE_BINARY,1); if (bUploaded == TRUE) AfxMessageBox(_T("Uploaded Successfully")); else AfxMessageBox(_T("Uploaded Does not Successfully")); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)