# Files

## Specs

| Label                     | Value                         |
| ------------------------- | ----------------------------- |
| **Version**               | 1.0.0 (updated on 2024-01-01) |
| **Developer**             | Labii Inc.                    |
| **Type**                  | Section                       |
| **Support Configuration** | Yes                           |

## Overview

The Files widget is a comprehensive file management tool that allows users to attach, preview, edit, and organize files of any type directly within a Labii record. It supports uploading new files via drag-and-drop or file picker, as well as linking previously uploaded files to a record. For supported formats — including images, Office documents, PDFs, scientific structure files, and plasmid maps — files can be previewed and edited inline without leaving the platform. Additional capabilities include file versioning, real-time antivirus scanning, mobile image cropping, and sign-and-lock behavior to protect attachments after a record is signed.

## Use Cases

* **Experiment Documentation**: Attach raw data files, analysis reports, gel images, or instrument output files directly to an experiment record for centralized documentation.
* **Contract and Agreement Management**: Link signed agreements or supporting documents to contract entries for easy reference and audit.
* **Scientific Data Attachment**: Upload chemical structure files, plasmid maps, or sequence files and preview or edit them inline without external software.
* **Regulated Workflows**: Use sign-and-lock behavior to freeze file versions after record signing, supporting data integrity requirements in GLP or GMP environments.
* **Collaborative File Review**: Share uploaded files with team members who can preview content directly in the record without downloading.

## Configuration

The Files widget works out of the box without required configuration. Optional settings allow customization of which fields are displayed and how the interface behaves.

{% stepper %}
{% step %}
Click the **Configure** (settings) button in the widget header.
{% endstep %}

{% step %}
Adjust the desired settings (see **Configuration Options** below).
{% endstep %}

{% step %}
Click **Save** to apply. Changes take effect immediately for all records using this widget.
{% endstep %}
{% endstepper %}

### Configuration Options

* **Fields** — Fields to display alongside each file entry.
* **Should Hide Column Data** — Hides column data for the default uploaded files view.
* **Should Hide Preview** — Hides the inline preview for the default uploaded files view.
* **View** — Choose between **Preview** (default, shows file preview and metadata) or **List** (tabular format with file name, size, type, and upload date).
* **Column Referenced** — A ForeignKey or ForeignKeys column referencing this record. When set, newly uploaded files are automatically assigned to that column.
* **Fields to Copy** — Fields to copy when linking files. Defaults to projects.

## Interface

### Preview View

The default view displays each attached file with its column data and an inline file preview. Action buttons allow users to toggle column data and preview visibility, download the original file, or delete the file entry. A drag-and-drop upload area and an **Add Existing File** button are available at the bottom of the widget.

<figure><img src="/files/0vwEVIwN4rvEKXLNWGDR" alt="Preview view of the Files widget showing file entries with inline previews and action buttons"><figcaption><p>The Preview view displays attached files with inline previews, column metadata, and per-file action controls</p></figcaption></figure>

### List View

The List view presents files in a structured table format showing key details such as file name, size, type, and upload date. This layout is more efficient when working with large numbers of attachments or when inline previews are not needed.

<figure><img src="/files/8qyv64DL24WywdDDO2TN" alt="List view of the Files widget showing files in a tabular layout"><figcaption><p>The List view provides a compact, sortable table of attached files for efficient browsing</p></figcaption></figure>

## Additional Functions

### Upload New Files

{% stepper %}
{% step %}
Drag and drop one or more files onto the upload area, or click the cloud icon to open a file picker.
{% endstep %}

{% step %}
Files are uploaded sequentially. The maximum supported file size per upload is **5 GB**.
{% endstep %}

{% step %}
Once uploaded, each file appears in the widget with its preview and metadata.
{% endstep %}
{% endstepper %}

### Add Existing Files

{% stepper %}
{% step %}
Click the **Add Existing File** button.
{% endstep %}

{% step %}
A modal opens. Select one or more previously uploaded files. Optionally specify a version to link.
{% endstep %}

{% step %}
Confirm the selection. The file is linked to the record without re-uploading.
{% endstep %}
{% endstepper %}

<figure><img src="/files/LogvLM9IqtGqkFJscwSC" alt="The Add Existing File modal showing file selection and version options"><figcaption><p>The Add Existing File modal allows linking previously uploaded files, with optional version selection</p></figcaption></figure>

### Image Cropping on Mobile Devices

On mobile, tapping the upload area gives the option to select an image from the gallery or take a new photo. A built-in cropping tool lets you trim the image before uploading, ensuring clean, focused attachments.

<figure><img src="/files/A8XDsqnUlyUKY7ZASdaO" alt="" width="356"><figcaption><p>The mobile image cropping tool lets you adjust photos before upload</p></figcaption></figure>

{% stepper %}
{% step %}
Tap the upload area on your mobile device.
{% endstep %}

{% step %}
Choose **Select from Gallery** or **Take Photo**.
{% endstep %}

{% step %}
Use the cropping tool to adjust the image boundaries for clarity and precision.
{% endstep %}

{% step %}
Confirm the crop and upload. The trimmed image is attached to the record.
{% endstep %}
{% endstepper %}

### Versioning

Whenever the content of an uploaded file is changed, a new version is automatically created. All previous versions remain accessible, providing a complete history of file modifications.

### Antivirus Scan

Labii can perform real-time antivirus scanning on all uploaded files. This feature is disabled by default.

To enable: navigate to **Settings → Organization Detail** and set **enable\_antivirus\_scan** to **true**.

All files carry one of three statuses:

* **Pending** — Awaiting antivirus scan
* **Clean** — Scanned and safe
* **Infected** — Malware detected; file is locked and quarantined (preview and download disabled)

The system sends a notification when malware is detected.

{% hint style="warning" %}
Enabling real-time antivirus scanning adds approximately 20 seconds to the file upload process.
{% endhint %}

### Sign and Lock

Any file uploaded after a record is signed is locked to its most recent version at the time of signing. If the file is modified later, the signed version remains visible for reference, supporting data integrity in regulated workflows.

## Supported File Types

| File Type          | Suffix                                                                                                                                                                                               | Preview | Editing |
| ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | ------- |
| Picture            | \*.jpg, \*.jpeg, \*.png, \*.gif, \*.bmp                                                                                                                                                              | Yes     | Yes     |
| Picture            | \*.tiff                                                                                                                                                                                              | Safari  | Yes     |
| Video              | \*.mp4                                                                                                                                                                                               | Yes     | No      |
| Audio              | \*.mp3                                                                                                                                                                                               | Yes     | No      |
| Text               | \*.txt                                                                                                                                                                                               | Yes     | Yes     |
| Tabular Data       | \*.tsv, \*.csv                                                                                                                                                                                       | Yes     | Yes     |
| HTML               | \*.html                                                                                                                                                                                              | Yes     | Yes     |
| PDF                | \*.pdf                                                                                                                                                                                               | Yes     | No      |
| Word               | \*.docx                                                                                                                                                                                              | Yes     | Yes     |
| Excel              | \*.xlsx                                                                                                                                                                                              | Yes     | Yes     |
| Presentation       | \*.pptx                                                                                                                                                                                              | Yes     | No      |
| Office 2013        | \*.doc, \*.xls, \*.ppt                                                                                                                                                                               | Yes     | No      |
| Chemical Structure | \*.cml, \*.inchi, \*.mol, \*.sdf, \*.smi, \*.cdx, \*.kcj, \*.mrv, \*.sd                                                                                                                              | Yes     | Yes     |
| Plasmid            | [\*.gb](https://fileinfo.com/extension/gbk), [\*.gbk](https://fileinfo.com/extension/gbk), [\*.ape](http://jorgensen.biology.utah.edu/wayned/ape/), \*.ab1, \*.fas, \*.fasta, \*.seq, \*.sbd, \*.dna | Yes     | Yes     |

## Best Practices

### File Organization

* Use descriptive file names before uploading so attachments are easily identifiable in the list view without opening each file.
* Use **Add Existing File** to link shared reference files (e.g., standard protocols, template documents) to multiple records rather than uploading duplicate copies.

### View Selection

* Use **Preview view** when working with a small number of files where inline rendering adds value (images, PDFs, structures).
* Switch to **List view** for records with many attachments where scanning file names and metadata is more efficient than rendering previews.

### Security and Compliance

* Enable antivirus scanning for organizations that accept files from external parties or untrusted sources.
* Rely on sign-and-lock behavior to freeze file versions at the point of record signing in regulated (GLP, GMP) workflows — do not upload replacement files after signing unless a new version trail is acceptable.

### Performance

* Keep individual uploads under 5 GB. For very large datasets, consider splitting into multiple files or using a linked storage reference.
* Be aware that antivirus scanning adds \~20 seconds per upload — communicate this to users when the feature is enabled.

### Common Pitfalls to Avoid

* **Avoid** deleting files that are referenced by signed records — this breaks the audit trail.
* **Avoid** uploading files without filling in relevant metadata fields (configured via **Fields**) — incomplete metadata reduces searchability and traceability.

## Related Widgets

* [**File Preview**](/widgets/section-widgets/office/file/file-preview.md): A lightweight alternative when only a single file preview is needed without full list management.


---

# 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/section-widgets/office/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.
