question

cubytestudio avatar image
cubytestudio asked

How to download the Avatar Photo of another user using Playfab?

Ok so, to state what I already know, the article about Entities describes how to upload the photo and download it as the user that uploaded it. When I upload it I set the Avatar URL as the DownloadUrl that i get when the upload finishes. The problem with this is that DownloadUrl expires.

What I need is when I match two players (opponents) I want to grab that other players Avatar photo.
What way can I achieve this, to Upload the photo as User No.1 and Download the photo as User No.2

Player DataentitiesFriends
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

·
Xiao Zha avatar image
Xiao Zha answered

>> When I upload it I set the Avatar URL as the DownloadUrl that i get when the upload finishes. The problem with this is that DownloadUrl expires.

The design that the DownloadUrl will expire is on purpose. If you want to get the Avatar image with the DownloadUrl, you should call API GetFiles to obtain a new URL. And we recommend using an external avatar hosting service to store the image and store the URL in PlayFab.

>> What I need is when I match two players (opponents) I want to grab that other players Avatar photo.

If you want to get other’s Avatar image from Avatar URL then you can call GetPlayerProfile API. After getting the URL, you can use some http download methods to get the avatar. If you want to get the Avatar image form other player’s Entity File then you can call GetFiles API in 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.

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.