Deleting Files

Deleting Files

The Backend Services JavaScript SDK provides methods for deleting single and multiple files based on an ID or a filter expression.

Single file

To delete a file by Id, you have to execute the following code snippet:

var el = new Everlive('your-app-id');
el.Files.destroySingle({ Id: 'item-id-here' },
    function(){
        alert('File successfully deleted.');
    },
    function(error){
        alert(JSON.stringify(error));
    });

Multiple files

Use the following code snippet in order to delete all files with size greater than 50000 bytes in a single operation:

var el = new Everlive('your-app-id');
var query = new Everlive.Query();
query.where().gt('Length', 50000);
el.Files.destroy(query, // filter
    function (data) {
        alert('Files successfully deleted.');
    },
    function(error){
        alert(JSON.stringify(error));
    });
Start a free trial Request a demo
Contact us: +1-888-365-2779
sales@telerik.com
Copyright © 2016-2017, Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.