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.
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.
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'base64After taking a photo in test mode, the memory function must look like the screenshot below.

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.

Last updated
Was this helpful?