Directus (flagbit) icon

Directus (flagbit)

Consume Directus API

Utility → Import File Data

AI-generated

Overview

This node operation imports file data into a specified collection within a system. It is useful for scenarios where users need to upload and integrate external file data into a database or content management system, such as importing articles, images, or other binary files into a designated collection for further processing or storage.

Use Case Examples

  1. Importing a CSV file containing user data into a 'users' collection for database population.
  2. Uploading image files into a 'gallery' collection to manage media assets.

Properties

Name Meaning
Collection Name Specifies the unique name of the collection where the imported file data will be stored. This is a required field and options are dynamically loaded via the 'getCollections' method.
Binary Property Defines the name of the binary property that contains the file data to be imported. This is a required string input indicating where the file data is located within the input.

Output

JSON

  • importResult - The result or status of the file data import operation, typically including success confirmation or error details.

Dependencies

  • Requires access to the collection management system to retrieve collection names and perform the import operation.

Troubleshooting

  • Ensure the 'Collection Name' is correctly specified and exists in the system; otherwise, the import will fail.
  • Verify that the 'Binary Property' name matches the property containing the file data in the input; incorrect names will cause the import to not find the file.
  • Check for proper permissions to write to the specified collection to avoid authorization errors.

Discussion