1001fx - NoCode functions icon

1001fx - NoCode functions

1001fx is a set of functions for any automation platform. Our functions are simple, very well tested, scalable and offer features that most automation platforms do not offer.

Actions74

files → Convert Asset into Base64 String

AI-generated

Overview

The "Convert Asset into Base64 String" operation in the files resource of this n8n node allows you to convert an asset (either from a URL or an uploaded file) into a base64-encoded string. This is useful when you need to embed files (such as images, documents, or other assets) directly into JSON payloads, HTML, or APIs that require base64 data instead of binary files.

Common scenarios:

  • Embedding images or files in API requests or responses.
  • Sending files over systems that only support text data.
  • Preparing assets for use in web applications or email templates.

Practical example:
You have an image hosted online and want to include it as a base64 string in an outgoing webhook or email body.


Properties

Name Meaning
URL The URL of the asset to be converted into a base64 string.
Add prefix Specifies if the prefix data:MimeType;base64, should be added to the result string. Default is true. Options: true, false.
Asset file Asset file to be processed. You can provide a file from previous workflow steps (e.g., from a file upload or another node's output).

Output

  • json: The output will contain a field with the base64-encoded string of the asset. If "Add prefix" is enabled, the string will start with data:MimeType;base64,.
    • Example:
      {
        "base64": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..."
      }
      
  • If there is an error during processing, the output will contain an error field with details about the issue.

Dependencies

  • External Service: Requires access to the 1001fx API.
  • API Key: You must configure the 1001fxApi credential in n8n.
  • Network Access: The node needs internet access to fetch assets from URLs and communicate with the 1001fx API.

Troubleshooting

Common issues:

  • Invalid URL: If the provided URL is incorrect or inaccessible, the node may return an error indicating the asset could not be fetched.
  • Missing Credentials: If the 1001fxApi credential is not set up, the node will fail to authenticate.
  • Large Files: Very large files may cause timeouts or memory issues.
  • Error messages:
    • "error": "Request failed with status code 404" – The asset URL does not exist.
    • "error": "Invalid file format" – The asset is not supported for conversion.
    • "error": "Authentication failed" – Check your API credentials.

How to resolve:

  • Double-check the asset URL or file input.
  • Ensure your API credentials are correctly configured in n8n.
  • Try with smaller files if you encounter timeouts.

Links and References

Discussion