---
url: /process-functions/datasource-binaryload.md
description: Note that this has been deprecated in favour of datasource.readFile
---

# datasource.binaryLoad&#x20;

:::info
Note that this has been deprecated in favour of [datasource.readFile](/process-functions/datasource-readFile)
:::

Returns a files contents as a base64-encoded string from the MODLR filesystem.

```js
datasource.binaryLoad(file_name)
```

#### Parameters

* `file_name` (string): The name (with path) of the file you want to load from the filesystem.

#### Returns

* `string`: A base64-encoded string representing the contents of the loaded file. Returns `null` if the file cannot be found or there's an error during the loading process.

#### Examples

```js
var base64Content = datasource.binaryLoad("path/to/my_file.bin");
if (base64Content) {
    console.log("File loaded successfully.");
    console.log("Base64 Content:", base64Content);
} else {
    console.log("Failed to load the file or file not found.");
}
```
