For the complete documentation index, see llms.txt. This page is also available as Markdown.

Write images from App to server

This tutorial explains how to share images taken inside an App with a local server or PC using the photo widget, an agent and the writeBufferToFile function.

1

Prepare the file connector agent

Download an Agent with the File I/O connector and start it on the server or PC where you want to store the images.

2

Add and configure the photo widget

Pick the photo widget from the input widgets and place it into the user interface of your App. Switch the storage type of the photo widget from file to buffer.

3

Prepare the photo data

Use a memory function to receive images from the photo widget by connecting the photo widget to the function's input. Add two JSONata modifier extension nodes to extract the base64 buffer string and to prepare the path and file name.

Use these JSONata snippets in your modifiers. Replace the path from the example with the path on your server where you want to store the images. Double all backslashes to work with the JSONata syntax.

'C:\\Data\\Images' & '\\' & name & '.jpeg'
base64

After taking a photo in test mode, the memory function must look like the screenshot below.

4

Configure the writeBufferToFile function

Find the writeBufferToFile function inside your file connector agent, which appears in the Function Explorer, and drag it onto the canvas.

Connect the path modifier to the filePath input and the buffer modifier to the buffer input.

5

Configure a trigger

Configure the trigger of the writeBufferToFile function as needed, for example on input change.

Last updated

Was this helpful?