> ## Documentation Index
> Fetch the complete documentation index at: https://docs.scanova.io/llms.txt
> Use this file to discover all available pages before exploring further.

# File Upload Schema

> Defines the structure for handling file uploads within QR Code categories. This component allows attaching, validating, and linking files such as documents, images, or media through a customizable upload button.

## Overview

The **File Upload Component** enables users to upload or attach files (e.g., images, PDFs, audio files) within QR Code-based landing pages.\
It supports multiple file formats with validation and integrates a **customizable button component** for initiating uploads or downloads.

## Properties

| Property                          | Type     | Required | Description                                                                                                                   |
| :-------------------------------- | :------- | :------- | :---------------------------------------------------------------------------------------------------------------------------- |
| **file**                          | `object` | ✅ Yes    | File details including URL, name, and MIME type.                                                                              |
| **file.url**                      | `string` | ✅ Yes    | URL of the uploaded file. Must follow the allowed file type pattern and be a valid URI.                                       |
| **file.type**                     | `string` | No       | File category (e.g., `image`, `document`, `audio`).                                                                           |
| **file.mime**                     | `string` | No       | MIME type of the file (e.g., `image/png`, `application/pdf`).                                                                 |
| [**file.name**](http://file.name) | `string` | No       | Original file name as uploaded.                                                                                               |
| **button**                        | `object` | ✅ Yes    | Reference to the [Base Button Component](/guides/category-components/components/button). Used for the upload/download action. |

***

### 🧩 **Supported File Types**

| Category      | Extensions                                                                                        |
| :------------ | :------------------------------------------------------------------------------------------------ |
| **Images**    | `.png`, `.jpg`, `.jpeg`, `.svg`, `.gif`                                                           |
| **Documents** | `.pdf`, `.doc`, `.docx`, `.xls`, `.xlsx`, `.ppt`, `.pptx`, `.odt`, `.ods`, `.odp`, `.txt`, `.csv` |
| **Audio**     | `.mp3`, `.wav`, `.aac`, `.m4a`                                                                    |
| **Scripts**   | `.js`                                                                                             |

***

## Used in Categories

This component is used in the following QR Code categories:

* [Coupon](/guides/category-components/categories/coupon)
* [Dynamic Text](/guides/category-components/categories/dynamicText)
* [Dynamic VCard](/guides/category-components/categories/dynamicVCard)
* [Event](/guides/category-components/categories/event)
* [Product](/guides/category-components/categories/product)
* [Social Media](/guides/category-components/categories/sMedia)
* [Wedding](/guides/category-components/categories/wedding)

## Example Schema

<CodeGroup>
  ```json Schema theme={null}
  {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "title": "File Upload Schema",
    "description": "File upload component.",
    "type": "object",
    "required": [
      "file",
      "button"
    ],
    "properties": {
      "file": {
        "type": "object",
        "required": [
          "url"
        ],
        "additionalProperties": false,
        "properties": {
          "url": {
            "type": "string",
            "format": "uri",
            "pattern": "(https?://.*\\.(png|jpeg|jpg|svg|gif|mp3|wav|aac|m4a|pdf|doc|docx|xls|xlsx|ppt|pptx|odt|ods|odp|txt|csv|js|PNG|JPEG|JPG|SVG|GIF|MP3|WAV|AAC|M4A|PDF|DOC|DOCX|XLS|XLSX|PPT|PPTX|ODT|ODS|ODP|TXT|CSV|JS))$"
          },
          "type": {
            "type": "string",
            "description": "Type of the file"
          },
          "mime": {
            "type": "string",
            "description": "MIME type of the file"
          },
          "name": {
            "type": "string",
            "description": "Name of the file"
          }
        }
      },
      "button": {
        "$ref": "_base_button.json"
      }
    }
  }
  ```
</CodeGroup>

## Notes

* The `file.url` field **must** be a valid URL pointing to a supported file type.
* Both `file` and `button` objects are **mandatory** for schema validity.
* Use the `tracking` property inside the button for analytics on user actions.
* File size restrictions (if any) are handled at the API or upload handler level.
