Download content is working but upload content is not working
I upload file name "25.bin"
first upload is work activate
but download that does not work
website is not displayed "25.bin".
"Bin2.bin" is uploaded with UPLOADFILES Button in website
Bin2.bin is no probelm to downlaod
why this error occur?
void LaterStart() { string Keyname = "25.bin"; UploadFileToCDN(Keyname); } 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") { WWWForm form = new WWWForm(); form.AddBinaryData("Data", content); UnityWebRequest www = UnityWebRequest.Post(presignedUrl, form); if (www.isNetworkError || www.isHttpError) { Debug.Log(www.error); } else { Debug.Log("Form upload complete!"); } }
Answer by Hernando · May 28, 2019 at 07:16 AM
I noticed that you use POST method to update data in your code. Actually, we provide very detailed tutorial about CDN: https://api.playfab.com/docs/tutorials/landing-content/cdn and it has mentioned that you must make HTTP PUT request to update data.
So we recommend editing your code base on this then trying to upload your data. If this problem still occurs in your latest test, network tools such as Wireshark can help you to check if there is any SSL connection issue between PlayFab server and you.