Brian Dunning's FileMaker Custom Functions

GetMIMEType ( fileNameOrExtension )

Returns MIME type when provided with a file path, file name, or file extension.

  Average rating: 5.0 (1 vote) Log in to vote

Kevin Koranda   Kevin Koranda - Show more from this author
Bureau Veritas

Share on Facebook Share on Twitter

  Sample input:
GetMIMEType( "test.jpg" )
  Sample output:
image/jpeg

  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.

Input options:
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

 

Comments

Log in to post comments.

 

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 16 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth: