I want that the client can upload files to Title Player Account-->Files and download files from Title Player Account-->Files.
I use the code from this tutorial: https://docs.microsoft.com/en-us/gaming/playfab/features/data/entities/quickstart
But I get an error message when I use PlayFabHttp.SimpleGetCall:
PlayFabHttp does not contain a definition for SimpleGetCall
private async Task GetActualFile(PlayFab.DataModels.GetFileMetadata fileData) { GlobalFileLock += 1; // Start Each SimpleGetCall var result = await PlayFabHttp.SimpleGetCall( { fileData.DownloadUrl }); if (result.Error != null) Console.WriteLine(result.Error.Error.ToString()); else { _entityFileJson[fileData.FileName] = Encoding.UTF8.GetString(result.Result); GlobalFileLock -= 1; } }
How can I use PlayFabHttp.SimpleGetCall to download a file from Title Player Account-->Files?
And I get an error message when I use PlayFabHttp.SimplePutCall:
PlayFabHttp does not contain a definition for SimplePutCall
private async Task UploadFile(string fileName) { if (GlobalFileLock != 0) throw new Exception("This example overly restricts file operations for safety. Careful consideration must be made when doing multiple file operations in parallel to avoid conflict."); ActiveUploadFileName = fileName; GlobalFileLock += 1; // Start InitiateFileUploads var result = await PlayFabDataAPI.InitiateFileUploadsAsync(new InitiateFileUploadsRequest() { Entity = new PlayFab.DataModels.EntityKey { Id = EntityID, Type = EntityType }, FileNames = new List<string> { ActiveUploadFileName } }); if (result.Error != null) { if (result.Error.Error == PlayFabErrorCode.EntityFileOperationPending) { //... } else Console.WriteLine("OnSharedFailure(error): " + result.Error.Error.ToString()); } else { string payloadStr; if (!_entityFileJson.TryGetValue(ActiveUploadFileName, out payloadStr)) payloadStr = "{}"; var payload = Encoding.UTF8.GetBytes(payloadStr); GlobalFileLock += 1; // Start SimplePutCall var resultsimpleput = await PlayFabHttp.SimplePutCall( { result.Result.UploadDetails[0].UploadUrl, payload, FinalizeUpload, }); if (resultsimpleput.Error != null) Console.WriteLine("Error."); else Console.WriteLine("SimplePutCall."); GlobalFileLock -= 1; // Finish InitiateFileUploads } }
How can I use PlayFabHttp.SimplePutCall to upload a file to Title Player Account-->Files?