question

shisonghua1071 avatar image
shisonghua1071 asked

GetContentDownloadUrl download file failed access denied

Hi I Use GetContentDownloadUrl to get the download url, while input the url to the browser it reports

the following error:


<Error> <Code>AccessDenied</Code> <Message>Access Denied</Message> <RequestId>6CE59BEFB2936E4B</RequestId><HostId> covc1dSteAfZCFKO/7mBQcYTbuyD/bmJaDhEaGsNP3uYZogBiETI9jGMyylpljVD11lHYg1eo0E= </HostId>

</Error>

While download from the GameManager will successfully.

how can I download the url successfully

Content
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

·
shisonghua1071 avatar image
shisonghua1071 answered

I guess I know.

when I input the key, I input key like this

"Key": "Root/PVPReward.xml"

I should remove the Root/, and it works again

3 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.

brendan avatar image brendan commented ·

Yes, the Key does contain the path to the content, but there's no "Root/" as part of that by default. One question, though - do you mean you were using "Root/" in the GetContentDownloadUrl call, and it was returning a URL?

0 Likes 0 ·
dragonfoundry avatar image dragonfoundry brendan commented ·

We've been able to get URLs for files that don't exist too (using the server api to check file status on a file update). I'd expect that the behaviour would be to return a failure, not a URL that doesn't work.

0 Likes 0 ·
brendan avatar image brendan dragonfoundry commented ·

Correct - the file request is formed based upon the inputs, which can refer to a Key that doesn't actaully exist in the S3 bucket that CloudFront points to. While I agree that it would be convenient for the GetContentDownloadUrl call to check for the existence of the Key, that would be a breaking change from the current behavior. Granted, it's possible that we wouldn't impact anyone, but we have a hard commitment to no breaking changes. If we update to a new model for Content in future, we can look at adding this check. For now, the way to check would be the error on the file download.

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.