---
url: /process-functions/datasource-filesize.md
description: Returns the size of a file.
---

# datasource.fileSize

Returns the size of a file.

```js
datasource.fileSize(fileName)
```

## Parameters

| Parameter | Type | Description |
|---|---|---|
| `fileName` | `string` | The path of the file. |

## Returns

The file's size in bytes, or `0` when the file doesn't exist or the path is invalid.

## Examples

```js
const bytes = datasource.fileSize("my_file.txt");
```
