ServerFileToClient (Magic xpa 3.x)

« Go Back


Created ByKnowledge Migration User
Approval Process StatusPublished

ServerFileToClient (Magic xpa 3.x)

Copies a file from the server to the client cache folder and returns this location.


ServerFileToClient (filename)


filename – The name of the file on the server. If no path or a relative path is specified, it will be relative to the project folder.

Wildcard characters and folder names can be used to send multiple files to the client. Since version: 2.4b


Alpha. The new location of the file on the client.

If there is an error, such as the file was not found, the function will return blank value.


Possible uses include:

  • Show an image or a PDF located on a non-exposed folder on the server

  • Copy files from the server to the client

  • Pass server resources to .NET methods


ServerFileToClient ('c:\images\my.bmp')
will copy the file 'my.bmp' from the 'c:\images' folder on the server to a location on the client and will return that location.


This function is available in Rich Client tasks and the Main Program for Rich Client use only.

Before transferring the file to the client, the function performs a request to check if the file on the server is newer than the file on the client cache. If the files have the same timestamp, the function will not copy the file to the client again.

Each call to the function performs a timestamp check, so evaluating the function multiple times for different files may pose a performance issue over a low-bandwidth network. Instead, it is advised to evaluate the function once and use wildcard characters or a folder name. In this case, the timestamp check will be done for all files in one request. Any updated files will be retrieved later on using separate requests.

Platform specific:

  • The function will copy the file from the server to the client according to the search mechanism described in the Alternative Images – Android and iOS topic.

  • Unicode names are not supported when the client is a mobile device.

See also:


How Do I Transfer Files Between the Server and the Client Machine?

The Rich Client Samples project (program RRC09)

Since version: