Overview
This node downloads files from the InterPlanetary File System (IPFS) using a specified IPFS gateway, Content Identifier (CID), and optional file path. It supports downloading the file as raw binary data, JSON, or plain text. This is useful for workflows that need to retrieve decentralized content stored on IPFS, such as fetching metadata, documents, images, or other files referenced by their CID.
Practical examples:
- Downloading a JSON metadata file stored on IPFS to process it in subsequent workflow steps.
- Retrieving an image or PDF file from IPFS as binary data to save or forward.
- Fetching a text file from IPFS for content analysis or transformation.
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 downloading. Currently supports "Web3 Storage" with URL format https://<<cid>>.ipfs.w3s.link . The placeholder <<cid>> is replaced with the actual CID. |
CID | The Content Identifier (CID) of the file to download. Required. |
Path | The path within the IPFS directory structure to the specific file to download. Optional. |
Mime Type | (Only for "Download as File") Optionally set the MIME type of the downloaded file. |
Overwrite File Name | (Only for "Download as File") Optionally overwrite the original file name of the downloaded file. |
Output
The output depends on the selected operation:
Download as File: Outputs binary data representing the downloaded file under the binary property named
data
. Additionally, the node sets metadata about the file such asmimeType
,fileName
,fileExtension
,fileType
(e.g., json, text, pdf, image, html),directory
, andfileSize
in the binary data object. If the input JSON is empty or missing, it populates the JSON output with afile
object containing these metadata fields plus the original input data.Download as JSON: Parses the downloaded file content as JSON and outputs it in the
json
field.Download as Text: Outputs the downloaded file content as plain text in the
json.content
field.
Dependencies
- Requires access to an IPFS gateway service to fetch files by CID and path.
- No explicit external API keys are required, but network access to the chosen IPFS gateway is necessary.
- The node uses HTTP GET requests to retrieve files from the constructed gateway URLs.
Troubleshooting
- Invalid CID or Path: If the CID or path is incorrect or the file does not exist at the specified location, the node will fail to download the file. Verify the CID and path correctness.
- Gateway Access Issues: Network issues or gateway downtime can cause request failures. Ensure the IPFS gateway URL is reachable and operational.
- JSON Parsing Errors: When using "Download as JSON", if the file content is not valid JSON, parsing will fail. Confirm the file content is proper JSON.
- MIME Type Mismatch: For "Download as File", setting an incorrect MIME type may affect downstream processing. Use this option only if you know the correct MIME type.
- Empty Response: If the response body is empty, the node returns no data. Check that the file exists and is accessible.