Actions74
- ai Actions
- array Actions
- audiovideo Actions
- carbone Actions
- charts Actions
- code Actions
- data Actions
- datetime Actions
- events Actions
- files Actions
- geo Actions
- hellospaces Actions
- images Actions
- Get Metadata of an Image
- Scale an Image
- Overlay an Image on another Image
- Scale an Image to Fit Given Dimensions
- Resize an Image
- Mask an Image with Another Image
- Mask an Image with a Circle Mask
- Crops an image by the given x, y, width and height paramters.
- Convert Texts to an Image
- Convert HTML String or URL to an Image
- Generates a QRCode with given text and color.
- Get EXIF from Image
- Remove EXIF from Image
- Modify Image EXIF
- playground Actions
- spreadsheet Actions
- stripe Actions
- youtube Actions
files → Convert Asset into Base64 String
AI-generatedOverview
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..." }
- Example:
- If there is an error during processing, the output will contain an
errorfield with details about the issue.
Dependencies
- External Service: Requires access to the 1001fx API.
- API Key: You must configure the
1001fxApicredential 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
1001fxApicredential 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.