aws-sdk-net: AmazonS3Client is missing `Create Presigned Post`
AmazonS3Client / IAmazonS3 is missing Create Presigned Post functionality found in JS/Python libraries. GetPreSignedURL does not appear to support POST. Therefore there seems to be no way to constrain max upload size when providing signed links using aws-sdk-net.
About this issue
- Original URL
- State: open
- Created 5 years ago
- Reactions: 35
- Comments: 26 (3 by maintainers)
Hi, I have started working on implementing this
ashishdhingra It’s been a while, any update on this?
@ashishdhingra Hi, any updates about PresignedPost for .net?
Got the above snippet to work with localstack by adjusting the base URL:
And for the upload to actually work, I used the following field name casings:
I ran up against this and was able to combine solutions and do a lot of tinkering on my own to hammer out an extended client that works with security tokens and
${filename}keys. Thank you so much for your contributions @greffgreff, @glen-84, and @zhuker. This should work fully as a copy-paste solution:Usage should work identical to @glen-84’s example. I consider this code temporary, this issue was raised to p1 and I hope that means AWS will add official support soon and all of this can be replaced with just using the real thing.
I implemented this in an extended AmazonS3 client.
Install
AWSSDK.S3andAWSSDK.Extensions.NETCore.Setup.In
Program.cs:Usage:
Disclaimer: No support or liability.
does it still missing content-length-range?
Haha yeah, you’re right, this was from my early attempts at making this all work. Updating it to its actual namespace seemed to be breaking something else, but I think it was a coincidence. Good call out, I’ve cleaned that bit up.
Yes, see also: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/s3.html?highlight=presigned#S3.Client.generate_presigned_post
I’m using PUT but (please correct me if I’m wrong) this does not provide for constraints like max file size or preventing update by link reuse.
This is a must.
Fork repo and get writing? 😁
We ended up implementing our own S3 presigned POST in F#. Inspired by the AWS SDK for JS
+1 for pre-signed post we also need it here
We’re also in need of pre-signed POST support, as
GetPreSignedURLdoesn’t meet our requirements (limiting the size of the uploaded files, and allowing only certain content-types).