0

Hi I manually uploaded an image on the newly created S3 Bucket using my AWS Account. My S3 Bucket policy is as follows

{
"Version": "2012-10-17",
"Statement": [
    {
        "Sid": "AddPerm",
        "Effect": "Allow",
        "Principal": "*",
        "Action": "s3:GetObject",
        "Resource": "arn:aws:s3:::s3BucketName/*"
    }
  ]
}

When I click on the S3 link generated for that image for that S3 bucket, I am unable to view or download the uploaded image. When I inspect element on the browser I am getting the following error

Failed to load resource: the server responded with a status of 403 (Forbidden)

My S3 Region is Oregon. Also my image size is just 3KB. Can somebody let me know what I am doing wrong?

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
shubhamagiwal92
  • 1,362
  • 4
  • 25
  • 47

1 Answers1

0

Your bucket policy file is okay. So this should work.

Check:

  • Did you save the policy file correctly (checked via web console)?
  • Did not you overwrite permissions on file level?
rmuller
  • 12,062
  • 4
  • 64
  • 92
  • I have saved the policy file correctly and what is meant by overwrite permissions on file level? – shubhamagiwal92 Jun 14 '16 at 12:58
  • I mean permissions on the file you try to download (the image). See for example [this thread](http://stackoverflow.com/questions/26691286/amazon-s3-bucket-returning-403-forbidden) – rmuller Jun 14 '16 at 13:05
  • @muller the issue still persists. When I Manually uploaded a 40 kb File, I am able to view and download the image. But when I try to upload a 3 kb file, I am unable to view or download the image. I checked the file permissions and everything is fine. – shubhamagiwal92 Jun 17 '16 at 13:00
  • so the *only* difference is the file size? In the same bucket? Uploaded the same way? – rmuller Jun 17 '16 at 13:46
  • @muller yes. The bucket is the same and it was uploaded manually in the same way. – shubhamagiwal92 Jun 17 '16 at 15:34