Write images from app to local 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.
Prepare file connector agent
Download an agent with file connector and start the agent on the server or PC you want to store the images.
Add photo widget and configure it
Pick the photo widget from 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 get images from the photo widget by connecting the photo widget with the memory functions input. Also, add two JSONata modifiers to the memory to extract the base64 buffer string and prepare the path and file name.
These are the JSONata snippets to use in your modifiers. Replace the path from the example with the path on your server where you want to store the images. All backslashes must be doubled to be working with JSONata syntax.
'C:\\Users\\gerri\\Desktop\\Demo\\Images' & '\\' & name & '.jpeg'
base64
The final memory function, after taking a photo in test mode, must look like in the screenshot below.

Last updated