anacronw / multer-s3

multer storage engine for amazon s3
MIT License
660 stars 190 forks source link

Is this available with aws lambda? #108

Closed wooooooak closed 3 years ago

wooooooak commented 6 years ago

I use aws lambda with node.js. multer-s3 is upload image file to the s3 and this image is downloadable like ec2 environment. but in lambda environment, image file is uploaded well but it is unable to download. I think lambda has something to do with this.

is this available with aws lambda? or is there any example?

shierro commented 5 years ago

@wooooooak have you found a work around with this issue? i also think that this might have something to do with lambda, because i tried uploading using a nodeJS app, and i can download/preview the image uploaded. but with my lamda app, the image uploaded cannot be recognized.

shierro commented 5 years ago

or might have to do with nodeJS version. my local node version is 10.15.1, and lambda runs on 8.10.0

i noticed that size uploaded by local nodejs app is 54% smaller, than what is uploaded through the lambda app. I wonder which layer the image size reduced. will keep digging!

LinusU commented 5 years ago

How are you deploying to Lambda? I think I've used Multer + Scandium so it should work, but it requires being able to handle base64-encoded bodies from API Gateway and passing them as a readable stream to multer...

shierro commented 5 years ago

fixed my issue with plugin serverless-apigw-binary

  apigwBinary:
    types:
      - '*/*'

AFAIR contentHandling

        - http:
            path: /order/{any+}
            method: ANY
            cors: true
            contentHandling: CONVERT_TO_BINARY # this one

also helped

boypanjaitan16 commented 4 years ago

Hey, I tried using this for lambda environment (node.js) but didn't work, can anyone give some guide ? or anything missing ?. I'm using claudia for deployment

LinusU commented 3 years ago

Closing due to inactivity...