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

> Macro (button-handy)



> 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;
}
```