kDrive icon

kDrive

Manipulate files from remote Kdrive

Actions6

Overview

This node integrates with the kDrive cloud storage service, allowing users to manipulate files and folders remotely. Specifically, for the File - Download operation, it downloads a file from a specified drive in kDrive and outputs the file data in binary form.

Common scenarios where this node is beneficial include:

  • Automating retrieval of files stored in kDrive for further processing or backup.
  • Integrating kDrive file downloads into workflows that require file content, such as document processing, data extraction, or sending files via email.
  • Building automated pipelines that fetch files on-demand based on triggers or schedules.

Example: Automatically download a report file named "sales-report.pdf" from a specific drive and use its content in subsequent workflow steps.

Properties

Name Meaning
Drive ID The unique identifier of the drive where the file is located.
File ID The unique identifier of the file to download within the specified drive.
File Name The name of the file to be downloaded; used to set the output file's name and MIME type.

Output

The node outputs an array of items, each containing:

  • json field:
    • Contains at least the fileId of the downloaded file.
  • binary field:
    • Contains a property named data (default binary property) which holds the downloaded file content encoded in base64.
    • Includes metadata about the file such as:
      • mimeType: The MIME type inferred from the file name extension (fallback to application/octet-stream if unknown).
      • fileName: The original file name as provided in the input.

This structure allows downstream nodes to access the raw file data for further processing or saving.

Dependencies

  • Requires an API authentication token credential for kDrive to authorize requests.
  • Uses the kDrive REST API endpoints under the base URL https://api.infomaniak.com/2.
  • Relies on the mime-types package to determine the MIME type from the file name extension.
  • n8n environment must have internet access to reach the kDrive API.

Troubleshooting

  • Common issues:

    • Invalid or expired API token will cause authorization failures.
    • Incorrect Drive ID or File ID will result in "not found" errors.
    • Network connectivity problems can cause request timeouts or failures.
  • Error messages:

    • Errors thrown by the node include HTTP response details when available.
    • If the download fails, the error message will indicate the failure reason, including URL and parameters used.
  • Resolutions:

    • Verify the API token is valid and has necessary permissions.
    • Double-check Drive ID and File ID values.
    • Ensure the file name matches the actual file to correctly infer MIME type.
    • Check network connectivity and firewall settings.

Links and References

Discussion