> For the complete documentation index, see [llms.txt](https://docs.appmixer.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.appmixer.com/connector-configuration/utils/converters/datauri2file.md).

# Data URI to File

### Overview

The **DataUri2File** component converts a Data URI into a file. It extracts the file content and metadata from the Data URI and generates a downloadable file.

### Input Parameters

| Parameter  | Type     | Required | Description                                                                                                          |
| ---------- | -------- | -------- | -------------------------------------------------------------------------------------------------------------------- |
| `dataUri`  | `string` | ✅        | A Data URI representation of a file.                                                                                 |
| `fileName` | `string` | ❌        | The desired name of the output file. If omitted, a default name (`result.[EXT]`) is assigned based on the file type. |

### Output Parameters

| Parameter  | Type     | Description                          |
| ---------- | -------- | ------------------------------------ |
| `fileId`   | `string` | The unique ID of the generated file. |
| `fileName` | `string` | The name of the resulting file.      |

### Instructions

1. **Provide a Data URI**
   * Input a valid Data URI string that represents a file.
2. **Specify a File Name (Optional)**
   * Enter a desired file name with or without an extension.
   * If omitted, the extension is inferred from the file type.
3. **Processing**
   * The component extracts the file content from the Data URI and saves it as a downloadable file.
   * Returns the `fileId` and `fileName` of the newly created file.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.appmixer.com/connector-configuration/utils/converters/datauri2file.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
