Files.FileExtension
-------------------

Queries the file extension of the given path.

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

MBS( "Files.FileExtension"; Path ) 

**MBS**( **"Files.FileExtension";** /\* Queries the file extension 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 text or error.

### Description

Queries the file extension of the given path.  
Returns file extension without dot.  
  
This function requires a native path. Use [Path.FileMakerPathToNativePath](PathFileMakerPathToNativePath.md) to convert a FileMaker path to a native path if required. If you like to have the user choose the path, you can use [FileDialog](component_FileDialog.md) functions.  
For Server be aware that server has limited permissions and may not be able to access all files on a computer.  
### Examples

Queries file extension of a file

 MBS ( "Files.FileExtension"; "C:\\test.txt" )  
<small>  
Example result: txt</small>### See also

- [MailComposer.AddAttachmentContainer](MailComposerAddAttachmentContainer.md)
- [MessageComposer.AddAttachmentContainer](MessageComposerAddAttachmentContainer.md)
- [Path.FileMakerPathToNativePath](PathFileMakerPathToNativePath.md)

### Example Databases

- [CURL/Amazon S3/Containers in S3](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/CURL/Amazon%20S3/Containers%20in%20S3.shtml#2ScriptAnchor_)
- [iOS/Examples/iOS Email Sending](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/iOS/Examples/iOS%20Email%20Sending.shtml#6ScriptAnchor_)
- [iOS/Examples/iOS Message Sending](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/iOS/Examples/iOS%20Message%20Sending.shtml#6ScriptAnchor_)

### 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 FileMaker Plugin, version 5.2pr1](https://www.mbsplugins.de/archive/2015-06-01/MBS_FileMaker_Plugin_version_5/monkeybreadsoftware_blog_filemaker)

### FileMaker Magazin

- [Ausgabe 4/2020, Seite 34](https://filemaker-magazin.de/neuigkeit/4103-Appetithappen-FMM_202004)

This function checks for a license.

Created 25th May 2015 , last changed 31st October 2024

  
[Files.FileExists](FilesFileExists.md) - [Files.FileInfo](FilesFileInfo.md)

[HTML Version](FilesFileExtension.shtml)