question

temes avatar image
temes asked

Can players delete their own saved data (Entity file)?

Similar to uploading a file from the client, is it possible for the client to delete their own Entity File on PlayFab?

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

·
Sarah Zhang avatar image
Sarah Zhang answered

Yes, you can check this API DeleteFiles for details. For example on Unity, you can use PlayFabDataAPI.DeleteFiles to delete the Entity files. You can refer to the following main code. Similar to uploading a file, before you use this API please make sure you enable the entity API too.

...

 void DeleteFile()
    {
        var request = new PlayFab.DataModels.DeleteFilesRequest
        {
            Entity = new PlayFab.DataModels.EntityKey { Id = entityId, Type = entityType },
            FileNames = new List<string> { ActiveUploadFileName },
        };
        PlayFabDataAPI.DeleteFiles(request, OnDeleteFilesSuccess, OnSharedFailure);
    }

...
10 |1200

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

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.