Encode or decode a local file as Base64
base64_convert_fileEncode a local file to Base64 or decode a Base64 text file without pasting contents; files are read-only and limited to 5 MB.
Instructions
Read a local file and encode its bytes to Base64, or decode a Base64 text file.
Use this when the data is in a file on this computer, so you don't have to paste it. The file is only read, never changed. Files larger than 5 MB are rejected; use the Apify version for bigger jobs. For decode, the file must be UTF-8 text containing Base64 (or a data URI), not a binary file.
path: full path to a file, up to 5 MB.
Returns the same result object as convert_text. If the decoded bytes are not UTF-8 text, "isText" is false and "text" is null.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"path": "<path>"
},
"name": "base64_convert_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Full path to a local file, up to 5 MB. For decode, the file must be UTF-8 text of Base64. | |
| action | No | What to do. "auto" (default) decodes if the input looks like Base64, otherwise it encodes. Use "encode" or "decode" when you already know the direction. | auto |
| data_uri | No | If true, encoded results also include a data: URI. The MIME type is guessed from the file name when we can. | |
| url_safe | No | If true, encode with - and _ instead of + and /. Decoding always accepts both. |