Lark Files icon

Lark Files

Lark Files Management

Overview

This node, named "Lark Files," is designed to manage files within the Lark (Feishu) ecosystem. Specifically, for the resource "Multipart Upload File" and operation "Upload A File In Blocks Upload Blocks," it facilitates uploading large files by splitting them into smaller blocks and uploading these blocks sequentially or in parallel. This approach is beneficial when dealing with large files that cannot be uploaded in a single request due to size limits or network reliability concerns.

Common scenarios include:

  • Uploading large documents, videos, or datasets to Lark's file storage.
  • Resuming interrupted uploads by sending only remaining blocks.
  • Efficiently managing bandwidth and upload reliability by chunking files.

Practical example:

  • A user wants to upload a 500MB video file to Lark. Instead of uploading it all at once, the node splits the file into smaller blocks and uploads each block separately, ensuring better stability and error handling.

Properties

Name Meaning
Authentication Method of authenticating API requests. Options: Tenant Token, OAuth2.
Use Custom Body Boolean flag indicating whether to send a custom JSON body instead of the default one.
Custom Body JSON object representing a custom request body to send when "Use Custom Body" is enabled.

Notes:

  • The "Custom Body" property is only shown if "Use Custom Body" is set to true.
  • The "Authentication" property determines which authentication method will be used for API calls.

Output

The node outputs data in JSON format containing the response from the Lark API after uploading file blocks. The structure typically includes information about the upload status, identifiers for the uploaded blocks, and any metadata returned by the API.

If binary data is involved (e.g., file content), it would be handled as part of the upload process but not outputted directly by this node; the node focuses on managing the multipart upload protocol rather than returning file binaries.

Dependencies

  • Requires access to Lark's Open API endpoint at https://open.larksuite.com/open-apis.
  • Needs either a Tenant Token or OAuth2 credentials configured in n8n for authentication.
  • No additional external libraries beyond those bundled with n8n are required.

Troubleshooting

  • Authentication errors: Ensure that the correct authentication method is selected and valid credentials are provided.
  • Upload failures: May occur if the file blocks are not correctly formed or if the API rate limits are exceeded. Check network connectivity and API quotas.
  • Invalid custom body: If using the "Custom Body" option, ensure the JSON is well-formed and matches the expected API schema.
  • Partial uploads: If an upload is interrupted, verify if the node supports resuming or if the entire upload must restart.

Links and References

Discussion