I am trying to upload content to PlayFab from the unity editor.
Fetching the upload url works just fine.
However using that url to actually upload something is not working for me. I guess i am missing something in the process.
I first tried using Unity's WWW class to upload content like this:
WWWForm form = new WWWForm();
//Set data to upload
form.AddBinaryData("data", data, "", mime);
//Add PUT header.
form.headers.Add( "X-HTTP-Method-Override", "PUT" );
//Start upload
WWW www = new WWW(url, form);
This gives me a 403 error.
I then tried using a WebClient like this:
//Ignore SSL certificates so the WebClient can send data to target url
ServicePointManager.ServerCertificateValidationCallback =
new RemoteCertificateValidationCallback(
delegate
{ return true; }
);
System.Net.WebClient client = new System.Net.WebClient();
//client.UploadData(new System.Uri(url), "PUT", data);
client.UploadFile(new Uri(url), "PUT", filePath);
Again, i get a 403 error.
I had a look at this thread
https://community.playfab.com/hc/en-us/community/posts/205469488-How-to-upload-files-to-PlayFab-s-Content-Service?input_string=Unity%3A%20Upload%20Content%20with
which mentions an attached file including an example for uploading content with unity. But i can't find an attachment.
Any ideas what i am doing wrong during the upload process?