BBjClientFile::copyFromClient
Description
In BBj 7.0 and higher, this method copies the file this BBjClientFile represents to the server and returns the name of the file to which it was copied.
In BBj 14.0 and higher, a server directory or fully-qualified server filename may be specified.
Syntax
Return Value |
Method |
---|---|
string |
copyFromClient() |
string |
copyFromClient(string p_serverFile) |
Parameters
Variable |
Description |
---|---|
serverFile |
The filename to create on the server (must not already exist), or the target directory of the copy (must exist). |
Return Value
Returns a string naming the file on the server to which the file was copied.
Remarks
This method provides an easy way for developers to use a BBx file type to store per-user configuration or data. Use the OPEN Verb to read and write the contents of the server-side file.
If no server file is specified, the contents of the file are saved in the "cache directory" of BBjServices. This may be configured in the BBjEnvironment tab of Enterprise Manager.
If serverFile is specified, it must correspond to an existing directory, or to a filename that does not already exist. If either condition is not met, this method will fail with !ERROR=13 .
In the BUI client, this method is only meaningful if the BBjClientFile was created from the server (createNewFile,setContents,copyToClient), or was selected on the client by the user, as shown in BBjClientFile Example 1. SeeInteracting with client files in BUI and DWC for a detailed discussion of the BUI BBjClientFile.
Example
See Also
See the BBj Object Diagram for an illustration of the relationship between BBj Objects.