React FileManager - Ajax.Methods

This section describes members used to manage file system items.

getItemContent()

Gets the specified items' content.

Parameters:
items:

Array<Object>

The specified items.

Return Value:

Promise<Object> (jQuery or native)

A Promise that is resolved after the items are obtained. It is a native Promise or a jQuery.Promise when you use jQuery.

The getItemContent returns the binary content (ArrayBuffer) of the specified items.

The following example illustrates how to obtain the specified item's image:

jQuery
index.js
$(function() {
    // ...
    function showFileContent() {
        const items = fileManager.getSelectedItems();
        const file = items[0];
        fileProvider.getItemContent([file])
            .done(function(arrayBuffer) {
                showImage(arrayBuffer);
            });
    };        
});