---
title: "fileExists"
canonical: "https://support.appfire.com/space/PSJC/434930064/fileExists"
format: markdown
---
> Macro (aura-html)


## Description

> Macro (excerpt)
> 
> Returns 'true' if the file exists and 'false' otherwise.

Returns 'true' if the file exists and 'false' otherwise.

|  |  |  |  |
| --- | --- | --- | --- |
| **Syntax** | fileExists(path_to_file) | **Package** | file |
| **Alias** |  | **Pkg Usage** | exists(path_to_file) |

## Parameters

| Parameter name | Type | Required | Description |
| --- | --- | --- | --- |
| path_to_file | String | Yes | Specifies the file name you want to search for. |

## Return Type

**Boolean (true/false)**

## Example

```javascript
if(fileExists("C:/someFile.txt")){
    print("The file exists!");
} else {
    print("The file does not exist!");
}
```

> ⚠️ It is recommended that you use forward slashes ( / ) for file paths.

## See also

> Macro (contentbylabel)