Directus (flagbit) icon

Directus (flagbit)

Consume Directus API

File → Update

AI-generated

Overview

This node updates a file object in the Directus system. It allows users to modify existing file metadata or upload new binary data to replace the current file content. This is useful in scenarios where file information needs to be updated or the file itself needs to be replaced without creating a new file entry. For example, updating the description or tags of a file, or uploading a new version of an image or document.

Use Case Examples

  1. Updating metadata fields of an existing file such as title or description.
  2. Replacing the binary content of a file by uploading new binary data.

Properties

Name Meaning
Send Binary Data Determines whether to upload new binary data to replace the existing file content.
ID Unique identifier of the file object to update.
Binary Property Name(s) of the binary property or properties containing the data to be uploaded as the new file content.
Update Fields Additional metadata fields of the file object to update, provided as a JSON object.

Output

JSON

  • id - Unique identifier of the updated file object.
  • data - Updated properties of the file object, including any changes made.

Dependencies

  • Requires connection to Directus API with appropriate authentication credentials.

Troubleshooting

  • Ensure the file ID provided is valid and exists in the Directus system to avoid 'file not found' errors.
  • If uploading binary data, verify the binary property names match the input data keys exactly.
  • Check that the API credentials have permissions to update files in Directus.
  • Malformed JSON in the 'Update Fields' property can cause errors; ensure valid JSON format.

Links

Discussion