MEGA icon

MEGA

Upload files to MEGA

Upload File

AI-generated

Overview

This node allows users to upload files directly to their MEGA cloud storage account by providing a file URL and specifying the target folder path within MEGA. It is useful for automating the transfer of files from external sources (accessible via URLs) into MEGA without manual download and upload steps.

Common scenarios include:

  • Automatically backing up files from web sources or other services to MEGA.
  • Integrating MEGA uploads into workflows that process or generate files accessible via URLs.
  • Centralizing file storage in MEGA as part of a larger automation pipeline.

For example, you could use this node to fetch an image or document from a public URL and upload it to a specific folder in your MEGA account for sharing or archival purposes.

Properties

Name Meaning
File URL The direct URL of the file to be downloaded and uploaded to MEGA.
Target Folder Path The destination folder path inside MEGA where the file will be uploaded. Default is root (/).

Output

The node outputs an array with one object per input item. Each output object contains a json field with the following structure:

  • success (boolean): Indicates whether the upload was successful.
  • fileName (string): The name of the uploaded file (extracted from the URL).
  • folderPath (string): The MEGA folder path where the file was uploaded.
  • shareLink (string): A shareable link to the uploaded file on MEGA.

If the upload fails and the node is configured to continue on failure, the output will contain:

  • success: false
  • error: The error message describing what went wrong.

The node does not output binary data.

Dependencies

  • Requires valid MEGA account credentials (email and password) to authenticate and access the MEGA storage.
  • Uses the megajs library to interact with MEGA's API.
  • Requires network access to fetch the file from the provided URL.
  • The node expects an API key credential for MEGA authentication configured in n8n.

Troubleshooting

  • Folder Not Found Errors: If the specified target folder path does not exist or is inaccessible in MEGA, the node throws an error indicating the folder was not found. Ensure the folder path is correct and exists in your MEGA account.
  • Authentication Failures: Incorrect or missing MEGA credentials will prevent login and cause errors. Verify that the email and password are correct and properly configured in n8n credentials.
  • File Download Issues: If the file URL is invalid, inaccessible, or the server blocks automated requests, the node will fail to fetch the file. Confirm the URL is reachable and publicly accessible.
  • Continue On Fail Behavior: When enabled, the node will output error details instead of stopping execution on failures, allowing workflows to handle errors gracefully.

Links and References

Discussion