# Files

## **Specs**

<table><thead><tr><th width="306">Label</th><th>Value</th></tr></thead><tbody><tr><td><strong>Version</strong></td><td>1.1.0 (updated on 2025-02-21)</td></tr><tr><td><strong>Developer</strong></td><td>Labii Inc.</td></tr><tr><td><strong>Type</strong></td><td>Column</td></tr><tr><td><strong>Support Configuration</strong></td><td>Yes</td></tr><tr><td><strong>Support Readonly view</strong></td><td>Yes</td></tr><tr><td><strong>Support Edit view</strong></td><td>Yes</td></tr><tr><td><strong>Support Form view</strong></td><td>Yes</td></tr><tr><td><strong>Support Default value</strong></td><td>Yes</td></tr><tr><td><strong>Support Import</strong></td><td>Yes</td></tr><tr><td><strong>Allow multiple</strong></td><td>Yes</td></tr></tbody></table>

## Overview

The Files Widget is a versatile tool that empowers users to both upload new files and select existing ones, providing a comprehensive solution for managing digital assets. This widget not only simplifies the process of adding files but also presents selected files with clickable links for easy access, enhancing the user experience by efficiently organizing and displaying digital resources.

The Files widget, when used as a column type, showcases file links, whereas in its section type, it offers file previews and allows for file editing.

## Use case

1. Use this widget to attach a file.

## Configuration

The widget is designed to function immediately without requiring any configuration. Nevertheless, you have the option to customize the information to be included when uploading a file.

* **Column Referenced -** The ForeignKey or ForeignKeys column that referenced to this record. If set, the current record will be assigned to the ForeignKey or ForeignKeys column when uploading new files.
* **Fields to Copy -** Fields to copy. Default to projects.
  * Copy From
  * Copy To

## Views

See the interface of the widget in the following views.

### **Readonly view**

Readonly view display the values of the column.

<figure><img src="/files/2eTzfG7sUqAtwqWBCkZL" alt=""><figcaption></figcaption></figure>

To upload new files, simply click the "Upload" button and select one or multiple files. Once chosen, the files will commence uploading and will be directly added to the widget's value.

### **Edit view**

The Edit view is the interface that allows you to modify the value.

<figure><img src="/files/eYOopUCaAb15x4McUVFC" alt=""><figcaption></figcaption></figure>

The Edit view resembles ForeignKeys but presents a list of files from which you can make selections.

### **Form view**

The Form view is the field integrated into the add form for collecting values when creating a new record.

The Form view is same as the Edit view.

## Data

Each widget in Labii stores data in a unique manner; refer below to understand how data from this widget is stored.

### Data format

Array of sid and names

```json
[
    {"sid": "xxx", "name": "xxx"}
]
```

### **Default value**

The Default Value field within the column allows you to specify the default value when a record is created.

Default value can be list of file UID separated by ",".

`FL1, FL2`

### **Import value**

The Import Value is the value you need to include in your Excel table for it to be imported into Labii.

Import value can be list of file UID separated by ",".

`FL1, FL2`


---

# 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.labii.com/widgets/column-widgets/form/file/files.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.
