question

kosar avatar image
kosar asked

Uploading A File To Playfab

Hello everyone, I would like to know how I can upload a very light file onto a player's data. Essentially this will be a 1KB file that will store some game information(save game material). I saw something about this in the documentation but I couldn't really figure it out as I would like to achieve this in Unreal Engine 4 Blueprint.

https://api.playfab.com/documentation/Data/datatype/PlayFab.Data.Models/PlayFab.Data.Models.InitiateFileUploadsRequest



I would greatly appreciate any help.

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

I am not sure how familiar are you with Blueprint. after the login, to call InitiateFileUploads API, you will need at least 2 properties which is Entity and FileNames in the request. Entity is a JSON Object that Blueprint doesn't directly support, but it includes in PlayFab SDK.

I have made 2 samples for you.

  • The Entity can be retrieved from the result of Login onSuccess callback.

  • If you stored the entity key and type somewhere else, you need to manually craft a JSON Object:


3 comments
10 |1200

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

kosar avatar image kosar commented ·

Thank you Seth, where would you actually declare what file to upload?

0 Likes 0 ·
Seth Du avatar image Seth Du ♦ kosar commented ·

the File Names in the API request is names of the files that will be stored in the player's account. A URL will be generated for uploading file in the OnSuccess callback.

Use that URL and select the files you want to upload. Basically it is a Blueprint question and in fact I am not expert in Blueprint. I believe you can find more information on Unreal Engine Documentation website.

0 Likes 0 ·
kosar avatar image kosar commented ·

Will play around with it more to see how it works. Much appreciated Seth

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.