---
title: File
url: https://www.tines.com/stories/docs/actions/types/file/
updated: 2026-11-24T14:43:52+00:00
---

*[tines.com](https://www.tines.com/llms.txt) › [Docs](https://www.tines.com/stories/docs/llms.txt) › [Actions](https://www.tines.com/llm/stories/docs/actions.md) › [Types](https://www.tines.com/llm/stories/docs/actions/types.md)*

# File

*[View on tines.com](https://www.tines.com/stories/docs/actions/types/file/)*

Use the File action to download a file into Files, store a file that is already in an event or resource, inspect a stored file, list files, send a stored file to another system, or delete a stored file. It is the building block for any story that needs to work with stored files or move them between systems.

![](https://www.datocms-assets.com/55802/1794947692-screenshot-2026-11-17-at-2-34-49-pm.png)

`Fetch` and `Capture` store a file and pass it on by GUID. Each later event carries the file's identifier and metadata, so other actions can reuse the same file without carrying its contents through the story run. 

## When to use the File action

Reach for the File action whenever a story needs to handle a real file rather than text or JSON. Common cases:

- **Fetch** — pull a report, export, or attachment from a URL and store it.
- **Capture** — store a file that an earlier action or a resource already returned, such as an HTTP response parsed as a file, an email attachment, or a file resource.
- **Inspect file **— retrieve a stored file’s metadata, optionally including its contents as Base64.
- **List files** — find files on the story’s team by filename, sort the results, and retrieve additional pages.
- **Upload file to URL** — forward a stored file to a ticketing system, storage bucket, or analysis tool.
- **Delete file** — clean up a stored file once a story no longer needs it.

Open **Files** in the team menu to see files created by this action, along with files uploaded in the app. Select a file and choose **Copy GUID** to reference it in a story. When you can download the file, the copy menu also includes **Copy download link**. Recipients of that link need to sign in and have permission to download the file.

![](https://www.datocms-assets.com/55802/1795531424-file-screenshot.png)

The story must belong to a team. **Fetch** and **Capture** are unavailable on a personal team. **Inspect file, List files, Upload file to URL** and **Delete file** can use only files that belong to the same team as the story.

## Choose a mode

| 
**Mode**

 | 

What it does

 |
| --- | --- |
| 

**Fetch**

 | 

Downloads a file from a URL and stores it in Files

 |
| 

**Capture**

 | 

Stores a file object from an event or resource in Files

 |
| 

**Inspect file  
**

 | 

Returns a stored file’s metadata, optionally including its contents as Base64

 |
| 

**List files  
**

 | 

Returns a filtered, sorted page of files belonging to the story’s team

 |
| 

**Upload file to URL**

 | 

Sends a stored file to a URL

 |
| 

**Delete file**

 | 

Removes a stored file from Files

 |

## Fetch a file

Fetch sends a GET request to **URL** and stores the response in Files. Fetch always uses GET. **Method** is not shown in this mode.

1. Add a **File** action and set **Mode** to **Fetch**.
2. Set **URL** to the file address. Use a formula when an earlier action supplies the address, such as `<<get_report.body.download_url>>`.
3. Add **Headers**, **Basic auth**, **Query params**, or **Timeout** when the download requires them. Timeout is in seconds and defaults to 30.
4. Leave **File name** blank to use the name from the response, then the name from the URL. Enter a name to override it. If you omit the extension, Tines adds one when it can determine the file type from the bytes. A name that already includes an extension is kept as entered.
5. Set **File retention**:
  
  - **Story retention** — keeps the file for the story's event-retention period, calculated when the file is created.
  - **Unlimited** — keeps the file until someone deletes it.
  - **Custom** — keeps the file for the number of days in **Retention period (days)**. Choosing **Custom** starts that value at seven.

A successful run emits an event like an HTTP request event. `status` is the download response, and `body` identifies the stored file:

```json
{
  "status": 200,
  "headers": {},
  "body": {
    "guid": "8ba6c462-251b-4757-9b40-d58927e52f02",
    "filename": "report.pdf",
    "content_type": "application/pdf",
    "byte_size": 2048,
    "sha256": "…",
    "story_run_guid": "…",
    "download_url": "https://your-tenant.tines.com/files/8ba6c462-251b-4757-9b40-d58927e52f02"
  }
}
```

Tines sets `content_type` and `sha256` from the stored bytes. The file then appears in **Files** for that team. If you later change the story's event retention, files already created keep the retention they were given.

A response that is not successful, such as a 404, does not store a file. **Emit failure event** defaults to **Never**, so the action logs the failure and the story run stops. Set it to **Always** when the story should continue with the error response.

## Capture a file

Capture stores a file that is already present as an object. It does not call a URL. Use it when an earlier action put the file in the event, or when the file lives in a resource, and you want that file in Files so later actions can pass it by GUID.

1. Set **Mode** to **Capture**.
2. Set **File reference** to the whole file object. The default is `=http_request.body`. For a file resource, use `=RESOURCE.my_file`. Include the object, not only its contents.
3. The object must contain the bytes in `base64encodedcontents` or `contents`, as Base64. Tines reads the name from `filename` or `name`. An HTTP request parsed as a file, an email attachment, and a file resource all use this shape. A GUID, content type, or checksum already on that object is not reused. Capture assigns a new GUID and derives the type and checksum from the decoded bytes.
4. Leave **File name** blank to keep the source name, or enter a name to override it. The same extension rules as Fetch apply. If the object has no name, Tines uses `file`.
5. Set **File retention** the same way as for Fetch. **Story retention**, **Unlimited**, and **Custom** are available here too.

A successful run emits the stored file, without an HTTP status:

```json
{
  "body": {
    "guid": "8ba6c462-251b-4757-9b40-d58927e52f02",
    "filename": "report.pdf",
    "content_type": "application/pdf",
    "byte_size": 2048,
    "sha256": "…",
    "story_run_guid": "…",
    "download_url": "https://your-tenant.tines.com/files/8ba6c462-251b-4757-9b40-d58927e52f02"
  }
}
```

If the value is not a file object, the bytes are not valid Base64, or the file is empty, Capture stores nothing.

## Inspect a file

Inspect returns information about a file that is already in Files. It does not create a new file.

1. Set **Mode** to **Inspect file.**
2. Set **File reference** to the file’s GUID, for example `<<get_file.body.guid>>`.
3. Leave **Include bytes** off to return metadata only. Turn it on to include the file’s contents as a Base64-encoded string in `base64encodedcontents`.

A successful run emits:

```json
{
  "body": {
    "guid": "8ba6c462-251b-4757-9b40-d58927e52f02",
    "filename": "report.pdf",
    "content_type": "application/pdf",
    "byte_size": 2048,
    "sha256": "…",
    "story_run_guid": "…",
    "download_url": "https://your-tenant.tines.com/files/8ba6c462-251b-4757-9b40-d58927e52f02"
  }
}
```

`story_run_guid` is `null` for files uploaded directly through the app. Recipients of `download_url` must sign in and have permission to download the file.

**Include bytes** supports files up to 75 MB. The resulting event, including the Base64-encoded contents and metadata, must also fit within the event payload limit. Metadata-only inspection does not have the 75 MB restriction. Use **Upload file to URL** to send larger files.

## List files

List returns files belonging to the story’s team, including files uploaded through the app and files created by other stories on that team. Deleted and expired files are excluded.

1. Set **Mode** to **List files**.
2. Optionally set **File name** to part of a filename. Matching is case-insensitive.
3. Choose ***Sort by**: **Newest first**, **Oldest first**, **Name**, **Size**, or **Expiring soonest.** The default is **Newest first**.
4. Set **Page size** to the number of files to return, from one to 1,000. The default is 100.
5. Leave **Page token** blank for the first page.

A successful run emits an object containing:

- `body.files` — an array of file metadata objects. Each object includes the same fields as Inspect, plus `created_at` and `expires_at`. Files with unlimited retention have `expires_at` set to `null`.
- `body.meta.next_page_token` — the token for the next page, or `null` when there are no more results.

To retrieve another page, use the previous result’s `body.meta.next_page_token` as **Page token**, keeping the same team, filename filter, and sort order. Stop when the token is `null`; a blank token starts again from the first page.

## Upload a file to a URL

Upload reads a file that is already in Files and sends it to **URL**. The default method is POST. Change **Method** when the destination expects GET, PUT, PATCH, or DELETE.

1. Set **Mode** to **Upload file to URL**.
2. Set **File reference** to a GUID. To use a file from an earlier File action named "Get file", use `<<get_file.body.guid>>`. To use a file already in Files, paste the GUID from **Copy GUID**.
3. Set **URL** to the upload address. Add **Headers**, **Basic auth**, **Query params**, or **Timeout** when the destination requires them.
4. Choose **Upload type**:
  
  - **Raw file** — sends the file as the request body, using the stored file's content type.
  - **Multipart** — sends the file as form data. Set **File field name** to the field the API expects. The default is `file`. Put any other form fields in **Additional data**.

The event is the destination's response, with `status`, `headers`, and `body`. It does not contain a new file GUID.

Multipart uploads cannot use GET. With **Multipart** selected, **Method** offers POST, PUT, PATCH, and DELETE. If **Additional data** already contains the file field name, rename **File field name** or remove that field from the additional data.

## Delete a file

Delete removes a file from Files. It does not call a URL.

1. Set **Mode** to **Delete file**.
2. Set **File reference** to the GUID, for example `<<get_file.body.guid>>`.

A successful run emits:

```json
{
  "guid": "8ba6c462-251b-4757-9b40-d58927e52f02",
  "filename": "report.pdf",
  "deleted": true
}
```

The file disappears from Files immediately. Contact support within seven days if you need it restored.

Testing the action does not delete the file. The test log says the deletion was simulated, and the event still reports `"deleted": true`.

## Pass a file through a story

**Download a file, then upload it somewhere else**

1. Add a File action named "Get file" in **Fetch** mode. Set **URL** to the download address.
2. Add a second File action in **Upload file to URL** mode.
3. Set **File reference** to `<<get_file.body.guid>>`.
4. Set **URL** to the upload address, and choose **Raw file** or **Multipart** to match that API.

**Store a file that is already in the event**

1. Add a File action in **Capture** mode.
2. Set **File reference** to the upstream file object, such as `=http_request.body` or `=receive_email.attachments[0]`.
3. Use `<<capture_file.body.guid>>` in a later upload or delete action.

**Use a file that is already in Files**

1. In **Files**, select the file and choose **Copy GUID**.
2. Paste the GUID into **File reference** on an upload or delete action. A formula can supply the GUID too, as long as it resolves to the identifier for a file on this team.

## Best practices

- **Set retention deliberately.** Use **Story retention** for transient files and **Custom** or **Unlimited** only when a file must outlive the story run.
- **Capture a file that is already in the event** instead of fetching it again. Fetch is for a URL. Capture is for an object you already have.
- **Prefer Raw file uploads** unless the destination API requires form data, then use **Multipart**.
- **Reference stored files by GUID through formulas** rather than copying their contents, so the story run stays lightweight.

## Limits

Each file can be up to 250 MB. The file must not be empty. Fetch and Capture store the bytes as they are and detect the content type from the file. You do not need to wrap a file in a zip to store it.

Fetch and Capture also fail when the team or tenant has no remaining file storage, or when the tenant has used its file upload allowance. **Files** shows how much storage the team is using. The upload allowance replenishes hourly within a rolling 24-hour window.

## Common issues

| 
What you see

 | 

What to check

 |
| --- | --- |
| 

Files is unavailable

 | 

Files is not enabled for this tenant

 |
| 

Files is unavailable for personal teams

 | 

Move the story to a team before using Fetch or Capture

 |
| 

Could not store file: File contents is empty

 | 

The URL or file object had an empty body

 |
| 

Could not store file: File must be a file object

 | 

**File reference** in Capture is not an object. Reference the whole file, such as `=http_request.body`

 |
| 

Could not store file: File must contain Base64-encoded base64encodedcontents or contents

 | 

The object has no `base64encodedcontents` or `contents` value

 |
| 

Could not store file: File contents is not valid Base64

 | 

`base64encodedcontents` or `contents` is not valid Base64

 |
| 

Could not store file: File is too large

 | 

The file is over 250 MB

 |
| 

Could not store file: File upload allowance exceeded

 | 

The tenant upload allowance is used up. Try again after it replenishes

 |
| 

Could not store file: Team storage quota exceeded, or Tenant storage quota exceeded

 | 

**Files** is full for the team or tenant

 |
| 

Failed with a 4xx or 5xx status

 | 

The request failed, so Fetch stored no file. Check the URL and credentials. Fetch always uses GET. Set **Emit failure event** to **Always** to emit the error response

 |
| 

File is unavailable

 | 

On Inspect or Delete, the file was deleted, the GUID does not identify a file, or the file belongs to another team

 |
| 

Could not build file entry, file is unavailable

 | 

On upload, the GUID is missing, the file was deleted, or the file belongs to another team

 |
| 

Could not build file entry, file field name is already in use

 | 

**Additional data** uses the same name as **File field name**

 |
| 

Multipart file uploads do not support GET

 | 

Set **Method** to POST, PUT, PATCH, or DELETE

 |
| 

File retention must be a positive number of days

 | 

**Retention period (days)** is missing, zero, or not a whole number

 |
| 

File is too large to include bytes

 | 

Turn off **Include bytes** to retrieve metadata only, or use **Upload file to URL** to send the file

 |
| 

File contents would exceed the event payload size limit

 | 

The Base64-encoded contents and metadata exceed the event limit. Turn off **Include bytes  
**

 |
| 

Page token is invalid

 | 

Use the same team, filename filter, and sort order as the previous page, or leave **Page token** blank to restart

 |

## Related pages

- [Actions overview](https://www.tines.com/stories/docs/actions/) — how actions fit together in a story
- [HTTP request action](https://www.tines.com/stories/docs/http-request/) — for requests that do not involve stored files
- [Formulas](https://www.tines.com/stories/docs/formulas/) — reference a file's GUID from an earlier action
- [Records](https://www.tines.com/stories/docs/records/) — link stored files to structured data
