Progress will discontinue Telerik Platform on May 10th, 2018. Learn more

Reading File Metadata

Reading File Metadata

The metadata of files stored by Telerik Platform can be retrieved like data from a regular content type. As a consequence, the read operation used for retrieving data items can be used for files too. The metadata contains the file's download URI.

In this article:

Single File

The following snippet can be used for getting the metadata of a file by its Id:

var el = new Everlive('your-app-id');
el.Files.getById('item-id')
    .then(function(data){
        alert(JSON.stringify(data));
    },
    function(error){
        alert(JSON.stringify(error));
    });

Multiple Files' Metadata by Filter

The following example shows how to get the metadata of files whose size is greater than 50000 bytes:

var el = new Everlive('your-app-id');
var query = new Everlive.Query();
query.where().gt('Length', 50000);
el.Files.get(query) // filter
    .then(function(data){
        alert(JSON.stringify(data));
    },
    function(error){
        alert(JSON.stringify(error));
    });

The metadata of files can also be paged and sorted.

Relation Expansion

When reading file metadata as a result of relation expansion, remember to refer to the Files content type as System.Files. See Expand Expression Examples for example code.

Contact us: +1-888-365-2779
sales@telerik.com
Copyright © 2016-2017, Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.