question

Deepesh Mishra avatar image
Deepesh Mishra asked

GetContentURL fails with signature invalid only for text files (.txt)!

Hey, we have currently moved our services to Playfab for one of our game, we are using:

Unity 2019.1.7 and uploaded our content(asset bundles, json's and a text file) on file management. But we are facing a difficulty where content downloaded for asset bundles, json files are working fine.

But while I do a request to getContent for an uploaded .txt files, the signed url says :

<Code>SignatureDoesNotMatch</Code>

><Message> The request signature we calculated does not match the signature you provided. Check your key and signing method. </Message> Any Idea why its only not working for a text file, if I just change the extension from .txt to .json then it works.Our title ID is 8FCD0and file uploaded is in a "Misc" folder. Any response for this would be great!

Expecting some good new here!

cheers,

Deepesh

Content
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Sarah Zhang avatar image
Sarah Zhang answered

Actually, maybe it's my mistake. If you have uploaded the file successfully, you needn't check the request body of GetContentUploadUrl again.

If you get this issue when you use the HTTP GET to download the file from content download URL. You should check the request body of GetContentDownloadUrl. I tried to request the GetContentDownloadUrl of your title, I can download the .txt file successfully from the URL of its response using HTTP GET. You can refer to the following request body. Then try again.

GetContentDownloadUrl Request Body

---------------------------------------------
{ 
"Key": "Misc/[your file name].txt"
}
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Sarah Zhang avatar image
Sarah Zhang answered

Do you determine the MIME type in the GetContentUploadUrl request body corresponds to your file? When you intend to upload the JSON file, the “ContentType” should be “application/json”, when you intend to upload a txt file it should be “text/[xxxx]”, for example, plain text txt files correspond to “text/plain”. Please check the MIME link for more content types. You can also check this post for more information about how to use CDN.

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Deepesh Mishra avatar image Deepesh Mishra commented ·

Hi @Sarah Zhang, thanks for the reply.

No we are not using GetContentUploadUrl to upload content, we are directly using playfab dashboard's Content->File management - upload files, there is no option present to select a MIME type, nor does it shows which MIME type is currently associated with the file.

after that we are just creating a new request for GetContentDownloadUrlRequest, with the path, that returns us a signed URL, which if we just try on browser also returns us the same error.

Do we have a way to see and change MIME type from dashboard?

Thanks again,

Deepesh

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.