Basically I'm able to upload videos using a signed url to an S3 bucket which is working fine right now but I'm wondering if there's any precautions to take to ensure the video files will upload.
Asked
Active
Viewed 94 times
0
-
"no videos are lost" lost where, how? – Marcin Jul 17 '21 at 23:56
-
This is actually a good question. but people will vote to close the question if you dont add any code with it. I will post an answer. – Arun Kamalanathan Jul 18 '21 at 01:23
-
1What do you mean by "precautions to take to ensure the video files will upload"? Please Edit your question to add more detail, or accept @ArunK's answer if that is what you were seeking. – John Rotenstein Jul 18 '21 at 03:37
1 Answers
0
I think you want to make sure that the video is entirely uploaded. In order to ensure the integrity of the file, you can supply the base64 encoded MD5 hash of the object when you make the api call to upload the file.
If the checksum that Amazon S3 calculates during the upload doesn't match the value that you entered for --content-md5, S3 won't store the object. Instead, you receive an error message in response. For more information, see Does the AWS CLI validate checksums?
The summary of the steps:
Calculate the md5 hash of the object locally
when the file is upload, provided the calculated hash as an argument. For example
aws s3api put-object --bucket bucket --key file.txt --body ./path --content-md5 samplemd5value1267==
Checking the integrity of the object being uploaded to amazon s3

Arun Kamalanathan
- 8,107
- 4
- 23
- 39