rlmcpherson / s3gof3r

Fast, concurrent, streaming access to Amazon S3, including gof3r, a CLI. http://godoc.org/github.com/rlmcpherson/s3gof3r
MIT License
1.14k stars 180 forks source link

Get file size #124

Open maddyblue opened 7 years ago

maddyblue commented 7 years ago

I've been attempting to fetch the file size (without downloading the contents) of an object using this package, but I don't think it's possible. I've been examining the headers returned by GetReader. They do contain a Content-Length header, but it is 0. newGetter uses the http response ContentLength field, which apparently is set correctly, but for some reason the http header is not also set. Are you aware of another way to get the file size? Or is it possible to expose an API that does it, or manually set the Content-Length header?