Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

265
Visualizações
AWS lambda function:put event is not triggered in direct browser upload in php

I've successfully created a lambda function that resizes an image and stores into a bucket in s3(bucket name:cropped). Also this lambda function invokes when a file is uploaded into another bucket(bucket name:source).

When i upload an image through aws console into the source bucket the AWS lambda function is triggered and the cropped image is created in cropped bucket.

But when i try with programmatic file upload ( s3 browser file upload) the lambda function is not triggered(cropped image is not creating in cropped bucket) however the image is successfully uploaded into source bucket.

Browser file upload

<form id="upload" action="//s3-us-west-2.amazonaws.com/lambdacushbu" method="POST" enctype="multipart/form-data">

    <input type="hidden" name="Content-Type" value="multipart/form-data" />
<input type="hidden" name="acl" value="private" />
<input type="hidden" name="success_action_status" value="201" />
<input type="hidden" name="policy" value="eyJleHBpcmF0aW9uIjoiMjAxNy0wMy0yNFQxMTo0NDoxMFoiLCJjb25kaXRpb25zIjpbeyJidWNrZXQiOiJsYW1iZGFjdXNoYnUifSx7ImFjbCI6InByaXZhdGUifSxbInN0YXJ0cy13aXRoIiwiJGtleSIsIiJdLFsiZXEiLCIkQ29udGVudC1UeXBlIiwibXVsdGlwYXJ0XC9mb3JtLWRhdGEiXSxbImNvbnRlbnQtbGVuZ3RoLXJhbmdlIiwwLDUyNDI4ODAwMF0seyJzdWNjZXNzX2FjdGlvbl9zdGF0dXMiOiIyMDEifSx7IngtYW16LWNyZWRlbnRpYWwiOiJBS0lBSlJWRVhVVFRWTjROWUFSUVwvMjAxNzAzMjRcL3VzLXdlc3QtMlwvczNcL2F3czRfcmVxdWVzdCJ9LHsieC1hbXotYWxnb3JpdGhtIjoiQVdTNC1ITUFDLVNIQTI1NiJ9LHsieC1hbXotZGF0ZSI6IjIwMTcwMzI0VDA1NDQxMFoifV19" />
<input type="hidden" name="X-amz-credential" value="AKIAJRVEARQ/20170324/us-west-2/s3/aws4_request" />
<input type="hidden" name="X-amz-algorithm" value="AWS4-HMAC-SHA256" />
<input type="hidden" name="X-amz-date" value="20170324T054410Z" />
<input type="hidden" name="X-amz-signature" value="854ea7ec0c456c03509d22a6de39b045e54b71a779af8d88175717d8b54ccebc" />
<input type="hidden" name="key" value="${filename}" />
    <input type="file" name="file" id="image">
    <br>
    <input type="submit" value="upload" name="upload">
        <span id="status-text"></span>
        <img src=""  id="cropped-image">
</form>

UPDATE

I've tried with normal file upload method ie user uploads file to my server and then it put into aws s3 bucket. Now its working

So i think there is an issue with direct browser upload

about 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

Finally i resolved the issue for the browser direct uploads the events is POST

For enabling

1.Go to s3 console and select the bucket.

2.Go to properties select Events and add a new event with POST

Create the event with post and choose your lambda function that you want to invoke and save.

about 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda