question

Alex Apps avatar image
Alex Apps asked

"HTTP/1.1 405 Method Not Allowed" when trying to download player avatar with SimpleGetCall

Hi, my question is regarding Unity playfab sdk.

I have implemented upload of player's avatar through SimplePutCall(). After upload i set the upload URL as player's profile avatar URL through PlayFabClientAPI.UpdateAvatarUrl().

But when I'm trying to download the avatar by the link from the player's profile next time player launches the game, i get HTTP/1.1 405 Method Not Allowed error as a response for the SimpleGetCall():

PlayFabHttp.SimpleGetCall(
	downloadUrl,
	result => { onFileLoadedCallback(result); },
	error => { Debug.Log(error); }
);
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

·
Alex Apps avatar image
Alex Apps answered

Nevermind, I figured it out myself.

The problem was caused by me using UploadURL of InitiateFileUploadsResponse as AvatarURL.

Instead, Metadata's DownloadURL from FinalizeFileUploadsResponse should be used as AvatarURL.

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.

Alex Apps avatar image Alex Apps commented ·

The previous error is gone, but now i only manage to get the file only once after uploading.

Then again, i get "HTTP/1.1 403 Forbidden" error on SimpleGetCall() using DownloadURL property from FinalizeFileUploadsResponse.

0 Likes 0 ·
Sarah Zhang avatar image Sarah Zhang Alex Apps commented ·

Could you please provide the sample code or the complete Http request for our reference?

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.