If you are getting this error: "Requests specifying Server Side Encryption with AWS KMS managed keys require AWS Signature Version 4", you have to configure the signature_version when you instance the client. For Python_: client(service_name="s3", region_name="us-east-1", config=Config(signature_version="s3v4"))
Thanks for content, always great content. Just a thought, at line #22 (7:42) you are transitioning from the developer role to the end user role, but this may not be clear to some in the audience. Said another way, you are generating the presigned url so that your user can upload to S3 (per your original diagram). A Part 2 😉, could clarify and expand. Again great content and a fundamental cloud pattern with many use cases in corporate.
Interesting. What would be some good example use-cases for this? I would have imagined exposing an upload endpoint to the user and handling the uploading ourselves would be the way to go. Would using a pre-signed url still make sense for this use-case, or better to just directly use boto3 s3 put call?
You don't want files to go through server and use server time. The files could be big and passing from client to server to S3 could take forever. A direct method is always better
File uploaded with presigned post perfectly but the content type is always binary/octet-stream instead of my passed content type e.g application/pdf or image/png , how to send the proper content type, actually I want to view the file from S3 instead of download when click the S3 link after upload. Because of binary/octet-stream it's download instead of view on browser.
what would the code look like if you are provided a user name, access key ID, secret access key and bucket name instead of you creating it the signed URL?
This should get you started... When user requests the upload file page, your server calls to get presigned url and fields, your server returns html to user with a form with method=POST action = presigned url and with hidden fields whose keys,values match the fields from s3 response, along with an input type=file. For better user experience and more flexibility like posting some data to your api and uploading the file from the same form, you'll probably want to prevent the default submit action, separate the data based on it's destination: your API vs s3, then use FileReader, FormData and xmlhttprequest to upload to s3.
I couldn't figure out how to do this in Swift, but this video gave me the idea to put the generator on Lambda! Awesome content always.
Thanks bud!. It has helped me
Would like it if you'd could continue this topic with presigned URL for multiparty upload
If you are getting this error: "Requests specifying Server Side Encryption with AWS KMS managed keys require AWS Signature Version 4", you have to configure the signature_version when you instance the client. For Python_:
client(service_name="s3", region_name="us-east-1", config=Config(signature_version="s3v4"))
Thanks for content, always great content. Just a thought, at line #22 (7:42) you are transitioning from the developer role to the end user role, but this may not be clear to some in the audience. Said another way, you are generating the presigned url so that your user can upload to S3 (per your original diagram). A Part 2 😉, could clarify and expand. Again great content and a fundamental cloud pattern with many use cases in corporate.
super dope😃 thank you bro
You're very welcome!
Love this video. Question though, why would this be done client side vs server side or in Lambda or another FaaS
Interesting. What would be some good example use-cases for this?
I would have imagined exposing an upload endpoint to the user and handling the uploading ourselves would be the way to go. Would using a pre-signed url still make sense for this use-case, or better to just directly use boto3 s3 put call?
You don't want files to go through server and use server time. The files could be big and passing from client to server to S3 could take forever. A direct method is always better
can you give me an example to make this request from react axio please ?
what is aws accesskey id in presigned url payload ? and how do i generate presigned url in lambda python?
File uploaded with presigned post perfectly but the content type is always binary/octet-stream instead of my passed content type e.g application/pdf or image/png , how to send the proper content type, actually I want to view the file from S3 instead of download when click the S3 link after upload. Because of binary/octet-stream it's download instead of view on browser.
what would the code look like if you are provided a user name, access key ID, secret access key and bucket name instead of you creating it the signed URL?
How would this work with file input or FileField?
This should get you started... When user requests the upload file page, your server calls to get presigned url and fields, your server returns html to user with a form with method=POST action = presigned url and with hidden fields whose keys,values match the fields from s3 response, along with an input type=file. For better user experience and more flexibility like posting some data to your api and uploading the file from the same form, you'll probably want to prevent the default submit action, separate the data based on it's destination: your API vs s3, then use FileReader, FormData and xmlhttprequest to upload to s3.
Policy Condition failed: ["eq", "$key"] can anyone tell me how to resolve this error
can you please please make this with nodejs
in my case, it doesn't display the image, it just downloads the image
Hi Tai,
This may be browser dependent.
Daniel
I was curious who the guy in the photo was (Jeff Goldblum?) but googling mr Hands is not advised 😂
I am getting a 405 for this. If someone can help me it would be much appreciated
same shit
like it
Thanks Christian!
@@BeABetterDev can you please tell me if those URLs are always the same length (I mean characters)? Does the length depen on file or anything else?