server.mime.fromBase64String
(FintechOS Studio 21.1.0 and later)
Returns the MIME type of a string encoded using the Base64 scheme.
Syntax
Copy
function server.mime.fromBase64String(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 getBase64Encoded function.
- We extract the file's MIME type and store in the fileType variable.
Copy
var fileType = server.mime.fromBase64String(getBase64Encoded('unkownFile'))