1

I am a bit confused on meaning of LastModified time in S3. Suppose I start upload of a large file at 10:00 AM and say upload takes 4 minutes. I am seeing that instead of showing LastModified time as 10:04 AM its showing the same as 10:00 AM, i.e. when I initiated the upload.

In Azure Blob Storage however lastModified time however seems to be the time when upload completed.

Am I interpreting this incorrectly for S3 ? I mean how can we have lastModified time as the time when upload starts because technically object is not created until all bytes are uploaded, right ?

Looking at answers like: amazon S3 upload object LastModified date keep changed? its confusing as they seem to be mentioning LastModified to be the time when upload finished.

Can anyone please confirm ?

snow_leopard
  • 1,466
  • 2
  • 20
  • 36

1 Answers1

0

Last-Modified is defined to be:

Object creation date or the last modified date, whichever is the latest.

Last modified is more like creation date, as mentioned in the docs:

Amazon S3 maintains only the last modified date for each object. For example, the Amazon S3 console shows the Last Modified date in the object Properties pane. When you initially create a new object, this date reflects the date the object is created. If you replace the object, the date changes accordingly. So when we use the term creation date, it is synonymous with the term last modified date.

It seems that it uses the value of the Date header as demonstrated in the PutObject example here - this will be, as you've seen, when the upload request was started and not when it finished.

Why S3 uses the Date header and not the timestamp of when the file has finished uploading is something internal to AWS AFAIK.

I have not seen the answer to the question, "why?" in the docs.

Ermiya Eskandary
  • 15,323
  • 3
  • 31
  • 44
  • 1
    Regarding PUT there seem to be certain examples (e.g. Example 6: Upload an object and specify tags) in https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html#API_PutObject_Examples where request time is different than time in response. Also do we know if this behavior of LastModified have been changed by AWS from start_upload time to end_upload time ? – snow_leopard Dec 10 '21 at 13:09
  • 1
    I assume this is because the tagging is done **after** the object has been uploaded - try the request. Does it behave the same way or …? – Ermiya Eskandary Dec 10 '21 at 21:52