question

Ethan K. G avatar image
Ethan K. G asked

Entity FinalizeFileUploads error: The file was not found on the profile

Get /File/FinalizeFileUploads error recently: The file was not found on the profile.

The same code works fine with player files, but get this error for group files. Also in the game manager Groups/Files, the size and date of the file look weird.

Any hint or suggestion?

entities
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.

Seth Du avatar image Seth Du ♦ commented ·

Would you share the reproduction steps with us ? Please make sure you are using HTTP PUT method to upload files.

0 Likes 0 ·
Seth Du avatar image
Seth Du answered

I have implemented the sample on my testing environment, and it works fine (after some grammar fixes).

Would you check the line 142, which is the definition of payloadStr. What value does it contain when the upload? By default, a string "{}" will be stored in the file, which takes 2 bytes.

4 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.

Ethan K. G avatar image Ethan K. G commented ·
@SethDu

Did you try group file or player file?

Here I have no problem with player file, but same code has error with group file.

0 Likes 0 ·
Ethan K. G avatar image Ethan K. G commented ·
@SethDu

FYI

When upload file to group, here is the code I used, which causes the error I mentioned:

var request = new InitiateFileUploadsRequest
{
    Entity = new PlayFab.DataModels.EntityKey { Id = groupId, Type = "group" },
    FileNames = new List<string> { ActiveUploadFileName },
};
PlayFabDataAPI.InitiateFileUploads(request, resultCallback, OnInitFileUploadFailed); 

When I change the EntityKey to {entity ID & "title_player_account"}, there is no such error. But file will be uploaded to the Players section, not Groups section, which is not I need.

It seems this issue only occurs recently. Any hint?

0 Likes 0 ·
Seth Du avatar image Seth Du ♦ Ethan K. G commented ·

I have tried to use Group, it still works fine. Besides of UploadFile function, you may also check the OnInitFailed and FinalizeUpload function, and make sure the Entity type is "group" in the request of API call, especially in the FinalizeUpload.

1 Like 1 ·
Ethan K. G avatar image Ethan K. G commented ·

"make sure the Entity type is "group" in the request of API call, especially in the FinalizeUpload."

This hint helps me out. Thanks!

0 Likes 0 ·
Ethan K. G avatar image
Ethan K. G answered
@SethDu Thanks for your reply.

This is an Unity client application. Basically I just copy the code in the document: https://docs.microsoft.com/en-us/gaming/playfab/features/data/entities/entity-files

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.