# 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: 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:

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

The question should be specific, self-contained, and written in natural language.
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.
