Twake Drive icon

Twake Drive

Basic Twake Drive

Overview

This node provides operations to manage files and folders within a Twake Drive instance. Specifically, the Copy File operation allows users to create a duplicate of an existing file, optionally specifying a new destination folder and/or a new name for the copied file.

Common scenarios where this node is beneficial include:

  • Creating backups or versions of important files by copying them to a designated backup folder.
  • Duplicating template files into project-specific directories with customized names.
  • Organizing files by copying them into different folders without altering the original.

For example, you might copy a report template file into a client’s folder and rename it to reflect the client’s name, automating document preparation workflows.

Properties

Name Meaning
File ID ID of the targeted file to be copied.
Choose Destination Folder Boolean option to specify whether to select a destination folder for the copied file.
Directory ID ID of the destination directory where the file will be copied (required if "Choose Destination Folder" is true).
Name of the New File Boolean option to specify whether to assign a new name to the copied file.
New Name The new name for the copied file, used only if "Name of the New File" is true.

Output

The node outputs JSON data representing the result of the copy operation. This typically includes metadata about the newly created file such as its ID, name, path, and other relevant attributes returned by the Twake Drive API.

If the node supports binary data output (not explicitly shown in the provided code for this operation), it would represent the actual file content of the copied file. However, for the Copy File operation, the output is primarily metadata in JSON format.

Dependencies

  • Requires an API key credential for authenticating with the Twake Drive service.
  • Needs the Twake Drive instance URL and API token configured in the credentials.
  • The node uses internal helper modules for file operations (FilesHelpers), which handle the HTTP requests to the Twake Drive API.

Troubleshooting

  • Invalid File ID: If the specified File ID does not exist or is incorrect, the node will throw an error indicating the file could not be found. Verify the File ID is correct.
  • Destination Directory Issues: When "Choose Destination Folder" is enabled but no valid Directory ID is provided, the operation will fail. Ensure the Directory ID corresponds to an existing folder.
  • Permission Errors: Insufficient permissions on the source file or destination folder can cause errors. Confirm that the API token has appropriate access rights.
  • Naming Conflicts: If a new name is provided that conflicts with an existing file in the destination folder, the API may reject the copy or overwrite depending on backend behavior. Check naming conventions and uniqueness.
  • API Connectivity: Network issues or incorrect API credentials will prevent successful execution. Validate credentials and network connectivity.

Links and References

Discussion