amazon web services - AWS API Gateway to S3 - PUT Content-Encoding .Z Files -


i have run issue using api gateway proxy s3 (for custom authentication), in not handle binary data (which known issue).

i'm uploading either .gz or .z (unix compress utility) files. far understand it, data not maintained due encoding issues. can't seem figure out way decode data binary.

original leading bytes: \x1f\x8b\x08\x08\xb99\xbew\x00\x03

after passing through api gw: ��9�w�

... followed filename , rest of data.

one way of 'getting around this' specify content-encoding in header of put request api gw 'gzip'. seems force api gw decompress file before forwarding s3.

the same not work .z files compressed unix compress utility. should specify content-encoding 'compress'.

does have insight happening data, shed light on issue? also, know possible work-around's maintain encoding of data while passing through api gw (or decode once it's in s3)?

obviously access s3 api directly (or have api gw return pre-signed url accessing s3 api), there few reasons why don't want that.

i should mention don't understand @ encoding - sorry if there obvious answers of questions.

it's not "encoding issue" -- it's fact api gateway doesn't support binary data ("yet")... it's going potentially corrupt binary data, depending on specifics of data in question.

uploading content-encoding: gzip triggers decoding in front-end component is capable of dealing binary data (gzip, after all, standard encoding , binary) before passing request body core infrastructure... find workaround not consistently deliver correct results, depending on specific payload. fact works @ seems more bug feature.

for now, consistently viable option base64-encoding payload, increases size on-the-wire 33% (base64 encoding produces 4 bytes of output every 3 bytes of input) it's not of solution. base64 + gzip appropriate content-encoding: gzip should work, seems quite silly suggestion (converting compressed file base64 gzipping result try reduce size on wire) should consistent api gateway can deliver.


Comments

Popular posts from this blog

amazon web services - S3 Pre-signed POST validate file type? -

c# - Check Keyboard Input Winforms -