question

dylan2malec avatar image
dylan2malec asked

Azure Functions File Upload

Hello, I am trying to upload files from the Azure Functions in order to in sure data validity (User sends data to Azure functions, azure functions does the file initialize, upload, and finalizations).

I have tried looking at the following documentation: https://learn.microsoft.com/en-us/gaming/playfab/features/data/entities/entity-files

The below is the closest thing I could find, but I dont understand how to use it (If thats what I should be using) 5552-image.png

It appears that I cannot directly access: PlayFabHttp.SimplePutCall on Azure Functions.

How do I accomplish this?

apissdks
image.png (13.2 KiB)
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

PlayFabHttp.SimplePutCall method is a method in UnitySDK. And the PlayFabAllSDK you used in Azure Function does not natively provide PlayFabHttp.SimplePutCall method. If you want to use this method, you may need to implement it by yourself.

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

dylan2malec avatar image dylan2malec commented ·

How wouldI accomplish this? I dont know where to start, thr SimplePutCall makes sense but where would I evenstart for the AzureFunctions code?

0 Likes 0 ·
Xiao Zha avatar image Xiao Zha dylan2malec commented ·

What SimplePutCall does is to use the UploadUrl obtained from InitiateFileUploadsResponse to make an http put request to modify the entire Url resource with data that is passed in the body payload, and then call the FinalizeFileUploads API to complete the file upload. The main thing you need to do is make an http put request. Here is a similar post you can have a look: SimpleGetCall implementation? - Playfab Community. In addition, you can refer to PlayFab CloudScript using Azure Functions - PlayFab | Microsoft Learn to have more information about PlayFab CloudScript using Azure Functions.

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.