RESTfmSync works with containers.
You need two global "support" fields in your server side tables for each container you want to sync:
- A text field for the Base64 encoding of the file in the container. Named "File_Base64" in our sample file, this is a global text field.
- A text field for the Name of the file in the container. Named "File_Name" in our sample file, this is a global text field.
This global text field is used by the RESTfmSync to push the Base64 encoded content of a container field back to the server.
This global text field is used by the RESTfmSync to push the name of the file in the container back to the server.
You will also need to add an Auto-enter calculation to the container field so that these two fields are combined back into a binary file.
Case ( IsEmpty ( File_Base64 ) ; Self ; Base64Decode ( File_Base64 ; File_Name ))
- If the container is a repeating field these two fields need to be set to the same number of maximum repetitions.
- Whatever your container fields are called, name these two global fields with a consistent extension, so fieldname_Base64 and otherfield_Base64 etc. Then fieldname_Name and otherfield_Name etc.
- These fields only need to exist on the server. You push into these two fields, and the auto enter calc sets the container. On the sync client, these two are created inside calculations, so are never stored in any fields.