I am using the Shrine gem to upload files to Amazon S3. Is there any way to retrieve the ETag value for a file and save it to the database after it has been uploaded? Ideally I would like to access the ETag value in the upload response to avoid having to do another request to Amazon.
I see ETag referenced a number of times in the gem but am not seeing a straightforward way: https://github.com/search?q=repo%3Ashrinerb%2Fshrine%20etag&type=code
I am not a Ruby on Rails developer, but here is something that I found might be helpful to you.
As per Shrine 2.17.0 documentation - Other improvements:
So, you can use Rack Response plugin to convert an
UploadedFileobject into a triple consisting of status, headers, and body. From there, you can retrieve theETagvalue from the headers.