My base url :
https://testbucket.s3.ap-south-1.amazonaws.com/ (where s3 testbucket is bucket name)
relative path : /myfiles/star.pdf ( where /myfiles is folder)
Discussion posts and replies are publicly visible
I copied your question into Google Gemini and got this:
Okay, a 404 "Not Found" error when trying to access an S3 object via its URL usually points to one of a few common issues, primarily related to permissions or the exact object path/name.
Let's troubleshoot step-by-step:
Verify Object Existence and Exact Path:
testbucket
ap-south-1
myfiles
star.pdf
MyFiles
Star.pdf
myfiles/star.pdf
Check Permissions (Most Likely Cause):
Allow
s3:GetObject
Principal: "*"
arn:aws:s3:::testbucket/myfiles/*
arn:aws:s3:::testbucket/myfiles/star.pdf
Deny
Verify the URL Format:
https://<bucket-name>.s3.<region>.amazonaws.com/<object-key>
testbucket.s3.ap-south-1.amazonaws.com/.../star.pdf
In summary, the most likely reasons for the 404 are:
Go through these checks in the AWS console, paying close attention to exact names and permission settings. Remember the security implications of making objects public.