Surajit Sarkar
Surajit Sarkar

Reputation: 129

Wrong Last Modified Date in AWS S3

While uploading file one by one to AWS S3 bucket using Java code, I'm observing a strange issue with Last Modified Date column, all the files are showing same last modified date. I followed few posted in StackOverFlow but no-where is properly mentioned on how to set user defied meta-data while storing file to S3.

I did like this in my code but didn't not work for me. Could you please suggest?

ObjectMetadata metaData = new ObjectMetadata();
metaData.setContentLength(bytes.length);
metaData.setHeader("x-amz-meta-last-modified", OffsetDateTime.parse(new Date().toString()).toLocalDate());

Upvotes: 0

Views: 1007

Answers (0)

Related Questions