---
title: "Get file name from path"
canonical: "https://support.appfire.com/space/PSJC/1222738333/Get%20file%20name%20from%20path"
format: markdown
---
> Macro (aura-html)


> Macro (excerpt)
> 
> Function to get the file name from a full file path.

```
function getFileName(string filePath) {
    int start = lastIndexOf(filePath, "\\");
    string fileName = trim(substring(filePath, start+1, length(filePath)));
    return fileName;
}
```