|
-
May 2nd, 1999, 08:58 PM
#1
Uploading a File to the FTP
Hi Everybody
I was having trouble and wondering if anybody could give me a short example of how to
-
May 5th, 1999, 01:04 AM
#2
Re: Uploading a File to the FTP
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
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
|