I make project mesh upload Donwload project and error is occured upload download
uploading succesfully but i don't know downloading
I convet mesh to binary file and upload
I download binary file and convert binary to mesh
2 error
1.I uploaded file but website Gamemanger/content/filemangement is not displayed
2. I download file but I do not know whether it is the correct file or not
i think that is not correct file
the reason is MeshSerializer doesn't work
MeshSerailizer worked fine without upload,download
This is upload cord
public void UploadFileToCDN (string key, byte[] content, string contentType = "binary/octet-stream") { GetUploadUrl(key, contentType, presignedUrl => { PutFile(presignedUrl, content, contentType); }); } void GetUploadUrl(string key, string contentType, Action<string> onComplete) { PlayFabAdminAPI.GetContentUploadUrl(new GetContentUploadUrlRequest() { ContentType = contentType, Key = key }, result => onComplete(result.URL), error => Debug.LogError(error.GenerateErrorReport())); } void PutFile(string presignedUrl, byte[] content, string contentType = "binary/octet-stream") { List<IMultipartFormSection> formData = new List<IMultipartFormSection>(); formData.Add(new MultipartFormDataSection("field1=foo&field2=bar")); formData.Add(new MultipartFormFileSection(content)); UnityWebRequest www = UnityWebRequest.Post(presignedUrl, formData); if (www.isNetworkError || www.isHttpError) { Debug.Log(www.error); } else { Debug.Log("Form upload complete!"); } }
this is cord Download cord
public void DownloadFileFromCDN(string key) { GetDownloadUrl(key, presignedUrl => { MeshSerializer.DeserializeMesh(GetFile(presignedUrl), GetComponent<MeshFilter>().mesh); }); } void GetDownloadUrl(string key, Action<string> onComplete) { PlayFabClientAPI.GetContentDownloadUrl(new GetContentDownloadUrlRequest() { Key = key, ThruCDN = true }, result => onComplete(result.URL), error => Debug.LogError(error.GenerateErrorReport())); } byte[] GetFile(string preauthorizedUrl) { UnityWebRequest www = UnityWebRequest.Get(preauthorizedUrl); // yield return www.SendWebRequest(); if (www.isNetworkError || www.isHttpError) { Debug.Log(www.error); return null; } else { byte[] results = www.downloadHandler.data; return results; } }
Have you called API FinalizeFileUploads after the upload? https://docs.microsoft.com/en-us/rest/api/playfab/data/file/finalizefileuploads?view=playfab-rest
According to the Documentation: after using the upload calls FinalizeFileUploads must be called to move the file status from pending to live.
Thank you for asking
use FinalizeFileUploads error is occured .
how to solve this error?
english is very hard language
i really appreciate you responding even if I write English strangely.
this is error part
PlayFabAuthenticationAPI.GetEntityToken(new GetEntityTokenRequest(),(entityResult) => { entityId = entityResult.Entity.Id; Debug.Log(entityResult.Entity.Id); entityType = entityResult.Entity.Type; PlayFab.DataModels.FinalizeFileUploadsRequest finalizeFileUploadsRequest = new PlayFab.DataModels.FinalizeFileUploadsRequest { Entity = new PlayFab.DataModels.EntityKey { Id = entityId, Type = entityType }, FileNames = Keyname }; PlayFabDataAPI.FinalizeFileUploads(finalizeFileUploadsRequest, OnUploadSuccess, OnSharedFailure); }, OnPlayFabError);
How to download content from cdn? 1 Answer
CDN upload is not work 1 Answer
GetContentDownloadUrl download file failed access denied 1 Answer
Slow response times 1 Answer
Best Approach for getting leaderboards (Login by FB) 1 Answer