可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
I am using the AmazonS3Client in an Android app using a getObject request to download an image from my Amazon S3 bucket.
Currently, I am getting this exception:
com.amazonaws.services.s3.model.AmazonS3Exception: The specified key does not exist. (Service: Amazon S3; Status Code: 404; Error Code: NoSuchKey;
Even though I am able to see the object with the specified key in my S3 bucket.
回答1:
回答2:
For me, the object definitely existed and was uploaded correctly, however, its s3 url still threw the same error:
<Code>NoSuchKey</Code> <Message>The specified key does not exist.</Message>
I found out that the reason was because my filename contained a #
symbol, and I guess certain characters or symbols will also cause this error.
Removing this character and generating the new s3 url resolved my issue.
回答3:
In my case the error was appearing because I had uploaded the whole folder, containing the website files, into the container.
I solved it by moving all the files outside the folder, right into the container.
回答4:
The reason for the issue is wrong or typo in the Bucket/Key name. Do check if the bucket or key name you are providing does exists.