GetMIMEType ( fileNameOrExtension )
Returns MIME type when provided with a file path, file name, or file extension.
Average rating: 5.0 (2 votes) Log in to vote
Kevin Koranda - Show more from this author
Function definition: (Copy & paste into FileMaker's Edit Custom Function window)
Returns MIME type from a comprehensive list when provided with a file path, file name, or file extension as input parameter.
Returns "application/octet-stream" if MIME type is not found in list.
From Path: GetMIMEType( "file:/C:/Users/Work/MyProject/.vscode/FileMaker/test.jpg" ) => image/jpeg
From File Name: GetMIMEType( "test.jpg" ) => image/jpeg
From Extension (w/period): GetMIMEType( ".jpg" ) => image/jpeg
From Extension (w out/period): GetMIMEType( "jpg" ) => image/jpeg
Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.