5

I've been getting permission denied errors when my app requests files through Javascript on amazon S3.

I have a CORS file set up and it seems to work most of the time, but fail intermittently.

I can always solve this problem by clearing my browser cache.

Any clues on what this could be? I'm not using cloudfront, which I know some people have found to cause a problem.

fab
  • 317
  • 4
  • 20
Jim
  • 521
  • 8
  • 14
  • Can you post sample code that is failing intermittently? Or, example requests and responses? – MathGladiator May 15 '13 at 02:27
  • Also your bucket policy? – Undo May 15 '13 at 03:33
  • Rejection: XMLHttpRequest cannot load https://s3.amazonaws.com/rifff_bucket/uploads%2F20130313T2336Z_5a9d96ef0d43ef775b9781cd336e1eb2%2Fsnarelayer.mp3. Origin http://localhost:3000 is not allowed by Access-Control-Allow-Origin. – Jim Jul 08 '13 at 09:17
  • Bucket Policy: http://localhost:3000 PUT POST DELETE * * GET – Jim Jul 08 '13 at 09:20
  • Sorry - Can't see how to format these better - any help very much appreciated. – Jim Jul 08 '13 at 09:20
  • Did you ever solve this issue? I have the same problem (not a localhost issue). – Andrew Hubbs Oct 07 '14 at 19:06
  • 1
    I seem to remember feeling that incognito mode solved it, and that no one apart from me experienced it - but that is only a very vague recollection. – Jim Oct 08 '14 at 20:14

1 Answers1

-5

As far as I remember, Chrome does not allow CORS requests made from localhost:

Rejection: XMLHttpRequest cannot load s3.amazonaws.com/rifff_bucket/…. Origin localhost:3000 is not allowed by Access-Control-Allow-Origin.

Try to setup a dev domain on your work PC.

Other then that, for me S3 also rejects CORS requests even though they aren't made from local host.

stoiczek
  • 1,333
  • 1
  • 8
  • 8