question

clintmasterson avatar image
clintmasterson asked

InitiateFileUploads with multiple files

I am new to playfab and not sure how to use InitiateFileUploads. I give the user the option to store their game to the cloud. The data consists of 9 files. If I use InitiateFileUploads 9 times, I get DataUpdateRateExceeded when uploading the last file. So I tried using InitiateFileUploads once with all file names i.e

PlayFabDataAPI.InitiateFileUploads(new PlayFab.DataModels.InitiateFileUploadsRequest()

{

Entity = new PlayFab.DataModels.EntityKey { Id = entityId, Type = entityType },

FileNames = new List<string> { "test1.csd", "test2.csd", ...

},

But I get EntityFileOperationPending every time.

How should I upload 9 files? Is there a way around the errors I am getting?

Many thanks.

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

·
Citrus Yan avatar image
Citrus Yan answered

The basic flow of uploading entity files is the following:

  1. Call InitiateFileUploads with the names of the files you want to upload, PlayFab will return each file’s UploadUrl in the response: https://docs.microsoft.com/zh-cn/rest/api/playfab/data/file/initiatefileuploads?view=playfab-rest#initiatefileuploadmetadata
  2. Use Http Put calls to upload each local file’s into their corresponding Upload Urls.
  3. Once step 2 is done, call FinalizeFileUploads to finalize file uploads.

“EntityFileOperationPending” suggests that your file uploads are not successful, did you follow the complete flow mentioned above? And, here is tutorial that demonstrates a full entity-file loop, hope you find it helpful: Entity files - PlayFab | Microsoft Docs

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.