> For the complete documentation index, see [llms.txt](https://docs.heisenware.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.heisenware.com/tutorials/app-templates/write-images-from-app-to-local-server.md).

# Write images from App to server

{% stepper %}
{% step %}

#### Prepare the file connector agent

Download an [Agent](/app-builder/build-backend/agents.md) with the [File I/O](/app-builder/build-backend/functions/connectors/file-i-o.md) connector and start it on the server or PC where you want to store the images.
{% endstep %}

{% step %}

#### Add and configure the photo widget

Pick the [photo](/app-builder/build-frontend/widgets/input-widgets/photo.md) 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.
{% endstep %}

{% step %}

#### Prepare the photo data

Use a [memory](/app-builder/build-backend/functions/utilities/data-processing.md#memory) function to receive images from the photo widget by connecting the photo widget to the function's input. Add two JSONata [modifier](/app-builder/build-backend/extension-nodes/modifier.md) 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.

<figure><img src="/files/kNdpr4XQP8GkGq0NBdiB" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

#### Configure the writeBufferToFile function

Find the [`writeBufferToFile`](/app-builder/build-backend/functions/connectors/file-i-o.md#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.

<figure><img src="/files/1FkZjtpSVcIUs1nMpk0g" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

#### Configure a trigger

Configure the trigger of the `writeBufferToFile` function as needed, for example `on input change`.
{% endstep %}
{% endstepper %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.heisenware.com/tutorials/app-templates/write-images-from-app-to-local-server.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
