ftos.files.getMimeType
IMPORTANT!
Starting with v24.3, this is renamed from server.mime.fromBase64String to ftos.files.getMimeType.
Starting with v24.3, this is renamed from server.mime.fromBase64String to ftos.files.getMimeType.
Returns the MIME type of a string encoded using the Base64 scheme.
This is suitable for business logic modules of business service components.
Syntax
Copy
function ftos.files.getMimeType(source: string): string
| Parameter | Type | Description |
|---|---|---|
source
|
string | Source contents encoded using the Base64 scheme. |
Return Value
Returns a string containing the MIME type if it matches one of the known MIME types or null otherwise.
Examples
In this example:
- We retrieve the Base64 encoded contents of the unknownFile file using the ftos.files.getBase64String function.
- We extract the file's MIME type and store in the fileType variable.
Copy
var fileType = ftos.files.getMimeType(ftos.files.getBase64String('unkownFile'))