function downloadFileFromBytes(fileName, mimeType, bytesBase64) {
    const link = document.createElement('a');
    link.href = `data:${mimeType};base64,${bytesBase64}`;
    link.download = fileName;

    // This is required for Firefox
    document.body.appendChild(link);

    link.click();

    document.body.removeChild(link);
}