FtpPutFileA function (wininet.h)
Stores a file on the FTP server.
Syntax
BOOL FtpPutFileA(
[in] HINTERNET hConnect,
[in] LPCSTR lpszLocalFile,
[in] LPCSTR lpszNewRemoteFile,
[in] DWORD dwFlags,
[in] DWORD_PTR dwContext
);
Parameters
[in] hConnect
Handle to an FTP session.
[in] lpszLocalFile
Pointer to a null-terminated string that contains the name of the file to be sent from the local system.
[in] lpszNewRemoteFile
Pointer to a null-terminated string that contains the name of the file to be created on the remote system.
[in] dwFlags
Conditions under which the transfers occur. The application should select one transfer type and any of the flags that control how the caching of the file will be controlled.
The transfer type can be any one of the following values.
The following values are used to control the caching of the file. The application can use one or more of the following values.
[in] dwContext
Pointer to a variable that contains the application-defined value that associates this search with any application data. This parameter is used only if the application has already called InternetSetStatusCallback to set up a status callback.
Return value
Returns TRUE if successful, or FALSE otherwise. To get a specific error message, call GetLastError.
Remarks
FtpPutFile is a high-level routine that handles all the bookkeeping and overhead associated with reading a file locally and storing it on an FTP server. An application that needs to send file data only, or that requires close control over the file transfer, should use the FtpOpenFile and InternetWriteFile functions.
If the dwFlags parameter specifies FILE_TRANSFER_TYPE_ASCII, translation of the file data converts control and formatting characters to local equivalents.
Both lpszNewRemoteFile and lpszLocalFile can be either partially or fully qualified file names relative to the current directory.
Like all other aspects of the WinINet API, this function cannot be safely called from within DllMain or the constructors and destructors of global objects.
Note
The wininet.h header defines FtpPutFile as an alias that automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that is not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows 2000 Professional [desktop apps only] |
Minimum supported server | Windows 2000 Server [desktop apps only] |
Target Platform | Windows |
Header | wininet.h |
Library | Wininet.lib |
DLL | Wininet.dll |