PiAPI File Upload icon

PiAPI File Upload

Upload temporary files that will be automatically deleted after 24 hours

Overview

This node uploads temporary files to a remote service where the files are automatically deleted after 24 hours. It supports multiple input methods for providing the file data: uploading from binary data within the workflow, downloading from a URL, or manually entering base64-encoded file content. This flexibility makes it useful in scenarios where you need to temporarily host files for short-term sharing, processing, or integration with other services that require a publicly accessible file URL.

Practical examples:

  • Uploading an image captured or generated earlier in the workflow to share via a link.
  • Downloading a file from a public URL and re-uploading it to a temporary hosting service.
  • Manually inputting small files (e.g., audio snippets or images) as base64 strings for quick upload without external dependencies.

Properties

Name Meaning
Input Method How to input the file to upload. Options: Binary File, URL, Manual Input
Binary Property The name of the binary property containing the file to upload (used when Input Method is Binary File)
File Name Name of the file including extension (e.g., jpg, mp4). Required when Input Method is Manual Input
File Data Base64 encoded file data. Required when Input Method is Manual Input
File URL URL of the file to download and upload. Required when Input Method is URL

Output

The node outputs an array with one item per input. Each output item contains a json object representing the response from the file upload API. This JSON includes details about the uploaded file, such as its temporary URL or identifier.

If an error occurs during processing an item and "Continue On Fail" is enabled, the output for that item will contain a json object with an error field describing the issue.

No binary data is output by this node; all results are returned as JSON metadata.

Dependencies

  • Requires an API key credential for authenticating with the remote file upload service.
  • Makes HTTP requests to:
    • Download files from URLs if the URL input method is used.
    • Upload files to the ephemeral resource API endpoint at https://upload.theapi.app/api/ephemeral_resource.
  • Uses n8n helper functions for HTTP requests and accessing binary data.

Troubleshooting

  • Error: No binary data exists on item!
    Occurs if the selected binary property does not exist on the input item when using the Binary File input method.
    Resolution: Ensure the binary property name matches exactly and that the previous node outputs binary data.

  • Error: No binary data found for field "X"!
    The specified binary property was not found on the current item.
    Resolution: Verify the binary property name and confirm the input item contains the expected binary data.

  • Error: File extension "X" is not supported. Supported extensions: jpg, jpeg, png, webp, mp4, wav, mp3
    Happens when manually inputting a file with an unsupported extension.
    Resolution: Use one of the supported file extensions listed in the error message.

  • HTTP request failures when downloading from URL or uploading to the API may occur due to network issues, invalid URLs, or incorrect API keys.
    Resolution: Check network connectivity, validate URLs, and ensure the API key credential is correctly configured.

Links and References

Discussion