question

Nguyễn Long avatar image
Nguyễn Long asked

How to get file using cloudscript ?

I want to access player file using cloudscript, i was read playfab document and follow this link PlayFab then I know playfab have a func call GetFile(), how to use this with playfab cloudscript, help me please !! thanks all

CloudScript
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Seth Du avatar image
Seth Du answered

GetFiles API is an entity related API as it requires X-EntityToken in the http header. To use those APIs in the Cloud Script, you need to call ExecuteEntityCloudScript in your client instead of ExecuteCloudScript. Then in the cloud script, you can use it via:

handlers.getfileTest = function (args, context) {


    var entityProfile = context.currentEntity;


    var getFileRequest = {


        Entity : entityProfile.Entity


    };


    var result = entity.GetFiles(getFileRequest);


    log.info( result.Metadata);


}
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Nguyễn Long avatar image Nguyễn Long commented ·

thank you so much !!!

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.