We have some Java services that upload files to an S3 compatible storage and generate Presigned URLs.
Other Java services receive such URLs and work on the files. We need the content length of this file, without loading the whole object from the body. Is this possible? And if yes, how?
We upload via
com.amazonaws.services.s3.AmazonS3.putObject()
and create URLs with
com.amazonaws.services.s3.AmazonS3.generatePresignedUrl()
When I check the Http Headers of a file using my S3 Browser, I can see the correct Content-Length entry.
But in our services we use
OkHttpClient.newCall(
new Builder().get()
.url(url).build()
).execute();
And in those Response objects there is no Content-Length.
question from:
https://stackoverflow.com/questions/66050941/can-i-get-the-header-detail-content-length-from-an-amazon-s3-presigned-url-usi 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…