Overview
This node downloads files from the InterPlanetary File System (IPFS) using a specified CID (Content Identifier) and optional path. It supports downloading the file as binary data, JSON, or plain text. This is useful for workflows that need to retrieve decentralized content stored on IPFS, such as documents, images, or JSON metadata.
Common scenarios include:
- Fetching media files or documents stored on IPFS for further processing.
- Retrieving JSON metadata associated with NFTs or decentralized applications.
- Downloading textual content from IPFS for analysis or display.
For example, you can use this node to download an image file from IPFS as binary data and then pass it to another node for uploading to cloud storage or sending via email.
Properties
Name | Meaning |
---|---|
Operation | The action to perform. Options: "Download as File" (binary), "Download as JSON", "Download as Text". |
IPFS Gateway | The IPFS gateway URL template to use, where <<cid>> is replaced by the provided CID. Currently supports "Web3 Storage" gateway. |
CID | The Content Identifier of the IPFS file to download. Required. |
Path | Optional path within the IPFS CID to specify a particular file or subdirectory. |
Mime Type | (Only for "Download as File") Override the MIME type of the downloaded file. |
Overwrite File Name | (Only for "Download as File") Overwrite the original file name of the downloaded file. |
Output
The output depends on the selected operation:
Download as File: Outputs binary data under the property
data
. The binary object includes metadata such as:fileName
: The file name, which can be overwritten or derived from the path.mimeType
: The MIME type, either detected or overridden.fileExtension
: The file extension extracted from the file name.fileType
: A simplified type classification (e.g., json, text, pdf, image, html).- Additional metadata like directory, file size, and id if available.
Additionally, the node outputs a JSON object containing file metadata (mimeType, fileName, fileExtension, fileType, etc.) and the input data for reference.
Download as JSON: Parses the response body as JSON and outputs it directly in the
json
field.Download as Text: Converts the response body to a string and outputs it under
json.content
.
Dependencies
- Requires access to an IPFS gateway URL that supports HTTP GET requests to fetch files by CID and path.
- No additional external API keys or credentials are required beyond network access to the chosen IPFS gateway.
- Uses standard HTTP methods internally; no special n8n credential types are needed.
Troubleshooting
- Invalid CID or Path: If the CID or path is incorrect or does not exist on IPFS, the node will fail to retrieve the file. Verify the CID and path correctness.
- Gateway Access Issues: Network issues or gateway downtime can cause failures. Try switching to a different IPFS gateway if available.
- MIME Type Mismatch: If the MIME type is incorrectly set or missing, downstream nodes might misinterpret the file. Use the "Mime Type" property to override if necessary.
- File Name Issues: If the file name is missing or incorrect, use the "Overwrite File Name" property to specify a proper name.
- Parsing Errors (JSON/Text): For "Download as JSON" or "Download as Text", ensure the content at the IPFS path matches the expected format to avoid parsing errors.