1

I have a little app which is accessing files on S3. I'm dealing with 3 different file types, and some are gzipped and some are not.

I've got a bit of code which is looking at the file type (unfortunately no extension, so I have to try decoding for the different type) but adding in that some files are zipped and some aren't is creating more overhead.

I'm hoping there is a way to request the content-encoding from s3, but haven't found anything in documentation.

If that isn't possible, is there a synchronous way of checking if the file's content-encoding? I don't see anything in the s3 object which shows the encoding, the only properties on S3 being returned are Content-Type, ETag, Body, Metadata, ContentLength and AcceptRanges.

Terry Li
  • 16,870
  • 30
  • 89
  • 134
pedalpete
  • 21,076
  • 45
  • 128
  • 239
  • 1
    Who uploads the object to S3 in the first place? You or someone else. – helloV Nov 25 '16 at 08:13
  • 1
    @helloV how is this relevant? the files were uploaded via an api. For some reason the original developer had some files gzipped, others not. I have no way of telling from our system which are which, if that's the line you're thinking... – pedalpete Nov 26 '16 at 02:04
  • When you upload, you can specify the file type as metadata. So that you can inspect the metadata before deciding to decode. – helloV Nov 26 '16 at 02:21
  • 1
    I know that, but that doesn't help. The problem is the files are already on s3 – pedalpete Nov 28 '16 at 02:59

0 Answers0