May 2nd, 1999, 08:58 PM
Hi Everybody
I was having trouble and wondering if anybody could give me a short example of how to
I was having trouble and wondering if anybody could give me a short example of how to
|
Click to See Complete Forum and Search --> : Uploading a File to the FTP May 2nd, 1999, 08:58 PM Hi Everybody I was having trouble and wondering if anybody could give me a short example of how to Steve White May 5th, 1999, 01:04 AM try this. m_pInetSession = new CInternetSession( NULL, 1, INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0); try { m_pFTPConnection= m_pInetSession->GetFtpConnection( (LPCTSTR)m_ftpHost_address, (LPCTSTR)m_ftpHost_username, (LPCTSTR)m_ftpHost_password, m_export_port, FALSE ); m_pFTPConnection->SetCurrentDirectory((LPCTSTR)newFtpDir); } catch (CInternetException* pEx) { // catch errors from WinINet TCHAR szErr[1024]; if (pEx->GetErrorMessage(szErr, 1024)) AfxMessageBox(szErr, MB_OK); else { strcpy(szErr,"FTP connection error"); AfxMessageBox(szErr, MB_OK); } pEx->Delete(); } int success = m_pFTPConnection->PutFile( (LPCTSTR)filepath,(LPCTSTR)outfile,FTP_TRANSFER_TYPE_BINARY,1); // Open File on server Steve White codeguru.com
Copyright Internet.com Inc., All Rights Reserved. |