question

fujioka avatar image
fujioka asked

Can a player gets a file of a Title entity?

I am trying to implement a process to upload an item image as a title entity file and then download it in the user application.

The admin could upload the image, but I don't know how the user can download it.

This is how the admin uploaded the file to the title entity.

  1. use GetEntityToken with SecretKey to get TitleEntityToken.
  2. InitiateFileUploads by the TitleEntityToken.
  3. finalizeFileUploads by the TitleEntityToken.

We have confirmed that the administrator can download the title entity's files with GetFiles.

However, it is not possible for regular users to download them.

There are two approaches:

  • The user can use GetEntityToken to get the TitleEntityToken.
  • GetFiles by using the "title_player_account EntityToken" given to the user upon login.

Both of these fail.

I also want to achieve this setting.

  • The user is allowed to Get the title entity's files, but not to Put, Post, or Delete them.
entities
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

·
Rick Chen avatar image
Rick Chen answered

A simple solution is to use the CloudScript to call the GetFiles API that gets the title entity files. Then the clients can use the ExecuteCloudScript API to get the file. For more information about CloudScript, please refer to: https://docs.microsoft.com/en-gb/gaming/playfab/features/automation/cloudscript/quickstart.

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.

fujioka avatar image fujioka commented ·

Very Good!

Thanks to your answer, I was able to implement it successfully.

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.