# File Preview

## Specs

| Label                     | Value                         |
| ------------------------- | ----------------------------- |
| **Version**               | 3.0.0 (updated on 2021-11-27) |
| **Developer**             | Labii Inc.                    |
| **Type**                  | Section                       |
| **Support Configuration** | No                            |

## Overview

The File Preview widget provides an instant, in-platform preview of files uploaded to the files table, allowing users to review document and media content without downloading files or opening external applications. It integrates directly with Labii's file storage, rendering supported file types — including images, PDFs, Office documents, and scientific formats — inline within the record. This widget is specifically designed to work with the files table, enabling quick visual inspection of attachments as part of standard laboratory and data management workflows.

## Use Cases

* **Document Review**: Quickly inspect uploaded PDFs, Word documents, or spreadsheets attached to a record without leaving the platform.
* **Image Verification**: Preview uploaded images (microscopy captures, gel images, instrument outputs) to confirm the correct file was attached.
* **File Replacement**: Replace an existing file with an updated version directly from the preview interface, keeping the record current.
* **Scientific File Inspection**: Preview chemical structure files or plasmid maps to visually verify uploaded scientific data without external viewers.
* **Audit and QC Workflows**: Review attached evidence files or reports during quality control or audit processes without downloading them.

## Configuration

The File Preview widget requires no configuration. It is ready to use immediately after being added to a record — no setup or adjustment is needed.

{% hint style="info" %}
The File Preview widget is designed specifically for use with the files table. It automatically renders a preview for any file format it supports.
{% endhint %}

## Interface

### Read-only View

The widget displays an inline preview of the currently uploaded file. The preview area renders the file content directly — images display as images, PDFs render as scrollable documents, and Office files are rendered in their native format. An option to upload a new file is also available, allowing users to replace the existing file without navigating away from the record.

<figure><img src="/files/ZDwscxehZIeMnm3wn3Dv" alt="The File Preview widget displaying an inline file preview with an upload replacement option"><figcaption><p>The File Preview widget renders supported file types directly within the record, with an option to replace the file</p></figcaption></figure>

{% hint style="info" %}
For a full list of supported file formats and their preview/editing capabilities, refer to the [Files widget documentation](/widgets/section-widgets/office/file/files.md).
{% endhint %}

## Additional Functions

### Replace a File

To replace the currently previewed file with an updated version:

{% stepper %}
{% step %}
Click the upload button within the File Preview widget interface.
{% endstep %}

{% step %}
Select the new file from your local system.
{% endstep %}

{% step %}
The new file is uploaded and the preview refreshes automatically to display the updated content.
{% endstep %}
{% endstepper %}

## Best Practices

### File Management

* Use the File Preview widget alongside the [Files](/widgets/section-widgets/office/file/files.md) widget — Files manages the full list of attachments, while File Preview provides focused inline rendering of a single file.
* Verify the preview renders correctly after uploading to confirm the file was not corrupted during transfer.

### Performance

* Very large files (e.g., high-resolution images or large PDFs) may take longer to render. Consider compressing files before upload if loading time is a concern.
* For file types not supported by the preview renderer, the widget will not display content — use the [Files](/widgets/section-widgets/office/file/files.md) widget to download and open those files locally.

### Common Pitfalls to Avoid

* **Avoid** using File Preview as a standalone file management solution — it is designed to complement the Files widget, not replace it.
* **Avoid** uploading unsupported file types expecting a preview; the widget will not render formats outside its supported set.

## Related Widgets

### Complementary Widgets

* [**Files**](/widgets/section-widgets/office/file/files.md): Manages attachment of multiple files to a record with full upload, download, preview, and edit capabilities. Use alongside File Preview for comprehensive file 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/file-preview.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.
