Group: Internet Functions (WinInet) - Library: wininet
Uploading local file to FTP server with FtpPutFile
Custom FTP Class for Visual FoxPro application
BOOL FtpPutFile(
HINTERNET hConnect,
LPCTSTR lpszLocalFile,
LPCTSTR lpszNewRemoteFile,
DWORD dwFlags,
DWORD_PTR dwContext
);
DECLARE INTEGER FtpPutFile IN wininet;
INTEGER hConnect,;
STRING lpszLocalFile,;
STRING lpszNewRemoteFile,;
INTEGER dwFlags,;
INTEGER dwContext
hConnect [in] Valid HINTERNET handle to an FTP session.
lpszLocalFile [in] Pointer to a null-terminated string that contains the name of the file to send from the local system.
lpszNewRemoteFile [in] Pointer to a null-terminated string that contains the name of the file to create on the remote system.
dwFlags [in] Unsigned long integer value that contains the conditions under which the transfers occur.
dwContext [in] Pointer to an unsigned long integer value
Returns TRUE if successful, or FALSE otherwise.
When you upload files using the FtpPutFile function you can start the process and wait until it finishes.
During the process you have no backward information, and then you can not estimate the uploading progress. Nevertheless this method is quite good on reliable FTP connections.
In a situation when you want to have more control on the process another function is more appropriate -- InternetWriteFile