ClientFileToServer (Magic xpa 3.x)

« Go Back


Created ByKnowledge Migration User
Approval Process StatusPublished

ClientFileToServer (Magic xpa 3.x)

Copies a file from the client to the server.


ClientFileToServer(client filename, server filename)


client filename The name of the file on the client. On mobile devices, if no path or a relative path is specified, it will be relative to the project cache folder.

server 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.


0 – success

1 – source not found

2 – destination cannot be created

3 – problem uploading


ClientFileToServer ('c:\temp\my.bmp', 'c:\images\my.bmp')

Will copy the my.bmp file from the c:\temp folder on the client machine to the c:\images folder on the server machine.


  • This is a client-side function that is only available for Rich Client tasks.

  • IIS limits the request size to 30 MB. There is an additional limit of 10 MB defined in the configurable web.config file, which is located in the scripts folder.

If you need to send larger files from the client to the server, change the value of the IIS as follows:

  1. Run the computer management (on your system, right-click on Computer and select Manage).

  2. Click Services and Applications and then Internet Information Services (IIS Manager).

  3. In the panel with all the icons, double click Request Filtering.

  4. In the Actions pane on the right, click Edit Feature Settings....

  5. In the Edit Request Filtering Settings dialog box, increase the value in the Maximum allowed content length (Bytes) field.

Platform specific:

  • On iOS devices, only access to the temp folder is allowed. You can either use a relative path or use ClientOSEnvGet('temp') to get the folder.

  • On Android devices, the file system is case sensitive. The names of Magic xpa related files, such as images and local databases are automatically saved in lower case (even if the file is defined with upper case letters). This function will not convert the file name to lower case. Therefore, if you need to refer to the destination file from Magic xpa, you should use a lower case name in the function.

See also:


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

The Rich Client Samples project (program RRC09)

Since version: