UixV2 equivalent of getting the contents of any M-Files file

Hi all,

In the Classic M-Files Desktop and Web, we used to be able to do something like this to get the file contents of a FileVer and display it in HTML:

/**
 * Gets the file content for a given FileVer object
 * @param objVer {ObjVer}
 * @param fileVer {FileVer}
 * @returns {string|void} The contents of the given file as a string
 */
function getFileVerSource(objVer, fileVer) {
    if (platform === Platform.Client) {
        return vault.ObjectFileOperations.GetPathInDefaultView(objVer.ObjID, -1, fileVer.ID, -1, 3, false);
    } else {
        return '/REST/objects/' + objVer.Type + '/' + objVer.ID + '/' + objVer.Version + '/files/' + fileVer.ID + '/content';
    }
}

However, I am yet to find a method that works in the new M-Files Client and Web. I would really like to be able to support displaying images in a dashboard.

Best regards

//Fred_

Parents Reply Children