Download icon

Download

Download a file from IPFS

Overview

This node downloads files from the InterPlanetary File System (IPFS) using a specified IPFS gateway. It supports downloading files as binary data, JSON, or plain text. This is useful for workflows that need to retrieve decentralized content stored on IPFS by specifying its Content Identifier (CID) and optionally a path within the IPFS directory structure.

Common scenarios include:

  • Fetching media or documents stored on IPFS for further processing.
  • Retrieving JSON metadata or configuration files from IPFS.
  • Integrating decentralized storage retrieval into automation workflows.

For example, you can download an image file stored on IPFS as binary data to save or forward it, or fetch a JSON file containing metadata for use in subsequent workflow steps.

Properties

Name Meaning
Operation The type of download operation to perform. Options: "Download as File", "Download as JSON", "Download as Text".
IPFS Gateway The IPFS gateway URL template to use for fetching the file. Currently supports "Web3 Storage" with URL pattern https://<<cid>>.ipfs.w3s.link. The placeholder <<cid>> is replaced with the actual CID.
CID The Content Identifier (CID) of the IPFS file to download. Required.
Path Optional path within the IPFS content to specify a particular file or subdirectory.
Mime Type (Only for "Download as File") Optionally override the MIME type of the downloaded file.
Overwrite File Name (Only for "Download as File") Optionally overwrite the file name of the downloaded file.

Output

The output depends on the selected operation:

  • Download as File: Outputs binary data representing the downloaded file. The binary data includes metadata such as fileName, mimeType, fileExtension, fileType, directory, fileSize, and an identifier. If the JSON output is empty, it populates it with file metadata and input data reference.

  • Download as JSON: Parses the downloaded content as JSON and outputs it in the json field.

  • Download as Text: Outputs the downloaded content as plain text under the json.content field.

Dependencies

  • Requires access to an IPFS gateway service (e.g., Web3 Storage) to fetch files via HTTP.
  • No explicit external API keys or credentials are required by the node itself, but network access to the chosen IPFS gateway must be available.
  • The node uses standard HTTP GET requests to retrieve files.

Troubleshooting

  • Invalid CID or Path: If the CID or path is incorrect or does not exist on IPFS, the request will fail or return empty results. Verify the CID and path correctness.
  • Gateway Unreachable: Network issues or misconfigured gateway URLs can cause failures. Ensure the IPFS gateway URL is accessible and correctly formatted.
  • Incorrect MIME Type: When downloading as a file, if the MIME type is not set correctly, downstream nodes might misinterpret the file. Use the "Mime Type" property to override if necessary.
  • Parsing Errors: For JSON downloads, invalid JSON content will cause parsing errors. Confirm the file content is valid JSON.
  • Empty Output: If no data is returned, check that the file exists at the specified CID and path.

Links and References

Discussion