Files.FileName
--------------

Queries the file name of the given path.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [Files](component_Files.md) | [2.9](newinversion29.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "Files.FileName"; Path ) 

**MBS**( **"Files.FileName";** /\* Queries the file name of the given path. \*/  
**$Path**) /\* Native path to the file to check.e.g. "C:\\test\\me.jpg" \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| Path | Native path to the file to check. | "C:\\test\\me.jpg" |

### Result

Returns file name as text or error.

### Description

Queries the file name of the given path.  
### Examples

Queries file name of a file

 MBS ( "Files.FileName"; "C:\\test.txt" )  
### See also

- [Files.DeleteLater](FilesDeleteLater.md)
- [Files.FileInfo](FilesFileInfo.md)
- [Files.FileKind](FilesFileKind.md)
- [Files.FileNameWithoutExtension](FilesFileNameWithoutExtension.md)
- [Files.FileSize](FilesFileSize.md)
- [GMImage.SetResolutionUnits](GMImageSetResolutionUnits.md)

### Release notes

- **Version 12.2**
    - Fixed an edge case for [Files.FileNameWithoutExtension](https://www.mbsplugins.eu/FilesFileNameWithoutExtension.shtml), where the path contains no slashes.
- **Version 11.2**
    - Fixed [Files.FileName](https://www.mbsplugins.eu/FilesFileName.shtml) and [Files.FileNameWithoutExtension](https://www.mbsplugins.eu/FilesFileNameWithoutExtension.shtml) to work on macOS in case you pass Windows path.
- **Version 11.1**
    - Added [Files.FileNameWithoutExtension](https://www.mbsplugins.eu/FilesFileNameWithoutExtension.shtml) function.
- **Version 8.5**
    - Changed [Files.FileName](http://www.mbsplugins.eu/FilesFileName.shtml) to work on Windows/Linux if last character in path is (back)slash.

### Example Databases

- [CURL/Email/Batch Emailer](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/CURL/Email/Batch%20Emailer.shtml#1ScriptAnchor_)
- [Drag and Drop/Better drag file from Container](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Drag%20and%20Drop/Better%20drag%20file%20from%20Container.shtml#2ScriptAnchor_)
- [Files/FileInfo](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Files/FileInfo.shtml#1ScriptAnchor_)
- [GraphicsMagick/SVG to PNG](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/GraphicsMagick/SVG%20to%20PNG.shtml#2ScriptAnchor_)

### Blog Entries

- [MBS FileMaker Advent calendar - Door 3 - Drag &amp; Drop](https://www.mbsplugins.de/archive/2024-12-03/MBS_FileMaker_Advent_calendar_/monkeybreadsoftware_blog_filemaker)
- [MBS Plugin Advent calendar: 12 - Files](https://www.mbsplugins.de/archive/2023-12-12/MBS_Plugin_Advent_calendar_12_/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 11.2pr3](https://www.mbsplugins.de/archive/2021-04-14/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 8.5pr5](https://www.mbsplugins.de/archive/2018-11-02/MBS_FileMaker_Plugin_version_8/monkeybreadsoftware_blog_filemaker)
- [MBS Filemaker Plugin, version 2.9pr3](https://www.mbsplugins.de/archive/2012-08-19/MBS_Filemaker_Plugin_version_2/monkeybreadsoftware_blog_filemaker)

### FileMaker Magazin

- [Ausgabe 4/2025, Seite 31 bis 32](https://filemaker-magazin.de/neuigkeit/4297-Appetithappen-FMM_202504)
- [Ausgabe 4/2020, Seite 33](https://filemaker-magazin.de/neuigkeit/4103-Appetithappen-FMM_202004)

This function checks for a license.

Created 18th August 2014 , last changed 18th August 2014

  
[Files.FileKind](FilesFileKind.md) - [Files.FileNameWithoutExtension](FilesFileNameWithoutExtension.md)

[HTML Version](FilesFileName.shtml)