How to enforce Content Type and Content Length Range using PreSignedURL #4297
Unanswered
huzaifaali14
asked this question in
Q&A
Replies: 1 comment
-
Hi @huzaifaali14, If you console.log() the presigned url, do you see content-length and content-type under SignedHeaders? Thanks, |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I actually have two questions
I can see that we have a support for content type while making a request to fetch pre-signed url for put request but no matter whatever type of file we upload using that signed url, it gets uploaded. Is there a way to validate that the content type of file should match with the type that was provided while generating the signed url?
How can I set content length range while generating presignedURL.
Here is what my request looks like.
const command = new PutObjectCommand({ Bucket: bucketName, Key: path, ContentType: 'image/jpeg', ContentLength: 2900000, ACL: 'public-read', });
const signedUrl = await getSignedUrl(this.awsClient, command, { expiresIn: Number(this.appConfig.downloadSignedUrlExpiryTime), });
Beta Was this translation helpful? Give feedback.
All reactions