I have a bucket with default ACL set to private. I want to generate pre signed url and distribute it to user so that they can upload the file and the file is needed to be publicly accessible after upload.
I can generate pre signed url and upload the file but the file always remains private. If i set ACL to 'public-read' while creating signed url then getSignedUrl() is generating a signed url but PUT request to that signed url throws access denied.
var params = {
Bucket: "bucket name",
Key: "file key name",
Expires: 3600,
ACL:"public-read",
ContentType: "application/octet-stream"
};
s3.getSignedUrl("putObject", params);
The bucket can contain either private or publicly accessible files and i want to set the privacy while creating a signed url. How i can achieve this?
I am using amazon javascript sdk.