Download icon

Download

Download a file from IPFS

Overview

This node allows downloading files from the InterPlanetary File System (IPFS) using a specified IPFS gateway. It supports multiple download operations, including downloading as a binary file, JSON, or plain text. The primary use case is to retrieve content stored on IPFS by specifying its Content Identifier (CID) and optionally a path within that CID.

Practical examples include:

  • Downloading an image or document stored on IPFS as a binary file for further processing or saving.
  • Fetching JSON data stored on IPFS and parsing it directly into the workflow.
  • Retrieving textual content from IPFS for logging, display, or transformation.

Properties

Name Meaning
IPFS Gateway The IPFS gateway URL template to use for downloading. Currently supports "Web3 Storage".
CID The Content Identifier of the file to download from IPFS. This is required.
Path Optional path within the CID to specify a particular file or subdirectory.
Mime Type (Only for "Download as File" operation) Optionally set the MIME type of the downloaded file.
Overwrite File Name (Only for "Download as File" operation) Optionally overwrite the original file name of the downloaded file.

Output

  • For Download as File: Outputs binary data representing the downloaded file. The binary data includes metadata such as fileName, mimeType, fileExtension, fileType (e.g., json, text, pdf, image, html), directory, and fileSize. If no JSON data exists in the item, a JSON object with file metadata and input data reference is added.

  • For Download as JSON: Outputs the parsed JSON content of the downloaded file in the json field.

  • For 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 GET requests.
  • No additional external API keys or credentials are explicitly required beyond access to the chosen IPFS gateway.
  • The node uses standard HTTP requests internally configured based on user parameters.

Troubleshooting

  • Common Issues:

    • Invalid or missing CID: The node requires a valid CID to locate the file on IPFS. Ensure the CID is correct and accessible.
    • Incorrect path: If specifying a path within the CID, verify the path exists; otherwise, the request may fail or return empty.
    • Network or gateway issues: The IPFS gateway might be down or unreachable, causing download failures.
    • MIME type mismatches: Setting an incorrect MIME type manually may cause improper handling of the file.
  • Error Messages:

    • HTTP errors (e.g., 404 Not Found): Usually indicate the CID/path does not exist or is inaccessible.
    • Parsing errors for JSON downloads: Occur if the downloaded content is not valid JSON.
  • Resolutions:

    • Double-check CID and path values.
    • Test the IPFS gateway URL independently in a browser or HTTP client.
    • For JSON downloads, ensure the content at the target location is valid JSON.
    • Adjust MIME type only if necessary and with correct values.

Links and References

Discussion