amazon-web-servicesamazon-s3file-uploadreliability

How to ensure file upload to storage?


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.


Solution

  • 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:

    Checking the integrity of the object being uploaded to amazon s3