Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
Text.FileExtensionToMimeType
Finds a mime type for a file extension.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
Text | 5.4 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
MBS( "Text.FileExtensionToMimeType"; FileExtension ) More
Parameters
Parameter | Description | Example |
---|---|---|
FileExtension | The file extension to lookup. Anything before a dot is ignored, so you can pass whole file name or path. | "test.pdf" |
Result
Returns OK or error.
Description
Finds a mime type for a file extension.Please report any missing mime type in our lookup table, so we can add more.
See also Text.MimeTypeToFileExtension.
Examples
Find mime type for PDF:
MBS("Text.FileExtensionToMimeType"; "pdf")
Example result: application/pdf
Find mime type for whole file name:
MBS("Text.FileExtensionToMimeType"; "my.test.pdf")
Example result: application/pdf
See also
- CURL.FormAddKeyValueContentType
- MailComposer.AddAttachmentContainer
- MailComposer.AddAttachmentFile
- MailComposer.AddAttachmentText
- MessageComposer.AddAttachmentFile
- SendMail.AddAttachmentContainer
- SendMail.AddAttachmentFile
- SendMail.AddAttachmentText
- SocialRequest.addMultipartContainer
- SocialRequest.addMultipartText
Release notes
- Version 13.5
- Fixed error message for Text.FileExtensionToMimeType function.
- Version 8.1
- Changed Text.FileExtensionToMimeType to prefer our table in the plugin to not report wrong type if your desktop database on Mac is broken.
Example Databases
Blog Entries
- MBS FileMaker Plugin, version 13.5pr6
- MBS FileMaker Plugin, version 8.1pr2
- MBS FileMaker Plugin, version 5.4pr1
This function is free to use.
Created 2nd October 2015, last changed 11st December 2016