Start a new topic

Update Kinvey Files metadata

I want to update my uploaded files meta data using flex service. Any way to do that in nodejs. Please help me it's urgent.

1 Comment

The sdk doesn't support it but the API behind it does so you can create a request manually and run it.


Here is a example of an ajax request that we make:

async function saveFileData(file, token, appKey) {

 

    return new Promise(function(resolve, reject) {

 

        var auth = 'Basic ' + token;

 

        var URL = "https://baas.kinvey.com/blob/" + appKey + "/" + file._id;

 

        $.ajax({

 

            url: URL,

 

            type: 'PUT',

 

            data: JSON.stringify(file),

 

            headers: {

 

                'content-type': 'application/json; charset=utf-8',

 

                'Authorization': auth,

 

                'X-Kinvey-API-Version': '3'

 

            },

 

            dataType: 'json',

 

            success: function(result) {

 

                resolve(result);

 

            },

 

            error: function(err) {

 

                reject(err);

 

            }

 

        });

 

    });

 

}


1 person likes this
Login or Signup to post a comment