|
Send a file to a FTP server.
syntax
FTPSendFile(
localFile,
remoteFolder,
requestID
)
Parameters
localFile
|
|
Type:
|
character
|
|
The name of the file to send. (This is a file in the public folder of the action.)
|
remoteFolder
|
|
Type:
|
character
|
|
The name of the destination folder. (A folder in the FTP server.)
|
requestID
|
|
Type:
|
character
|
|
0 - Synchronous communication (after execution, the method waits until the transmission is completed).
1 or more - Asynchronous communication. (After execution, the method will immediately terminate and the OnFTPRequestDone event will notify you of whether it was successful. The RequestID will be passed in the event.)
|
Return Value
|
|
Type:
|
Boolean
|
|
FALSE - Failure. TRUE - Success.
|
Explanation
Send a file to the FTP server
In the case of synchronous communication, you can determine whether the transmission was successful from the return value. If it takes a long time to send the file, set the timeout setting (PSTimeOut root property) to a longer value.
|
Example
In case of synchronous communication
|
if (!this.FTPSendFile("data\sample.txt", "www/data", 0)
{
::OpenMessage(this.GetLastError());
}
|
In the case of asynchronous communication, the OnFTPRequestDone event is used to determine whether the request was successful.
Asynchronous communication is recommended if the FTP transfer may take a long time.
|
reference
FTPSetServer
FTPSendFile
FTPAppendFile
FTPReceiveFile
FTPRenameFile
FTPDeleteFile
FTPMakeFolder
FTPDeleteFolder
|