|
|
| INT FtpPutFile(
|
|
|
HCLIENT
hClient, |
|
|
|
|
LPCTSTR
lpszLocalFile, |
|
|
|
|
LPCTSTR
lpszRemoteFile, |
|
|
|
|
DWORD dwOptions |
|
|
|
|
DWORD dwOffset |
|
|
| );
|
The FtpPutFile function transfers the specified file on
the local system to the remote server.
Parameters
- hClient
- Handle to the client session.
- lpszLocalFile
- A pointer to the null-terminated string that specifies the file
that will be transferred from the local system. The file pathing
and name conventions must be that of the local host.
- lpszRemoteFile
- A pointer to the null-terminated string that specifies the file
on the remote system that will be created, overwritten or appended
to. The file pathing and name conventions must be that of the
remote host.
- dwOptions
- A bitmask which specifies one or more options. This parameter
may be any one of the following values:
| Constant |
Description |
| FTP_TRANSFER_DEFAULT |
This option specifies that the
default transfer mode should be used. If the remote file exists, it
will be overwritten with the contents of the uploaded file. |
| FTP_TRANSFER_APPEND |
This option specifies that if the
remote file exists, the contents of the local file is appended to
the remote file. If the remote file does not exist, it is
created. |
- dwOffset
- A byte offset which specifies where the file transfer should
begin. The default value of zero specifies that the file transfer
should start at the beginning of the file. A value greater than
zero is typically used to restart a transfer that has not completed
successfully. Note that specifying a non-zero offset requires that
the server support the REST command to restart transfers.
Return Value
If the function succeeds, the return value is the server result
code. If the function fails, the return value is FTP_ERROR. To get
extended error information, call FtpGetLastError.
Remarks
This function will cause the current thread to block until the
file transfer completes, a timeout occurs or the transfer is
canceled. During the transfer, the FTP_EVENT_PROGRESS event will be
periodically fired, enabling the application to update any user
interface controls. Event notification must be enabled, either by
calling FtpEnableEvents, or by registering a callback
function using the FtpRegisterEvent function.
To determine the current status of a file transfer while it is
in progress, use the FtpGetTransferStatus function.
Requirements
Client: Requires Windows Vista, Windows XP or Windows
2000 Professional.
Server: Requires Windows Server 2008, Windows Server 2003 or
Windows 2000 Server.
Header: Include cstools6.h.
Library: Use csftpav6.lib.
Unicode: Implemented as Unicode and ANSI versions.
See Also
FtpChangeDirectory,
FtpEnableEvents, FtpGetData, FtpGetFile, FtpGetMultipleFiles, FtpGetTransferStatus, FtpPutData, FtpPutMultipleFiles, FtpRegisterEvent, FtpSetBufferSize, FtpVerifyFile
|
|