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

224
Visualizações
File upload via API in Express.js: Notification after file upload

We are trying to build a large file (size>30MB) upload from Android and iOS phones, for that created an Express.js API for file upload.

Endpoint: user/upload

uploadFile:function(req,res){

    //upload files to AWS s3 asychrnous
    s3.upload(params,options,function(err, data) {
        //when upload complete
        //need a help on this part
        if(data){
          //Send a notification to client
        }
    });

    res.json({
        status:true,
        'message':'Upload ongoing'
    });
}

When user requests the API (user/upload) it immediately give this response:

{
  status:true,
  'message':'Upload ongoing'
}

Because the upload is asynchronous. So how can I notify the client when upload completes?

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

0

For the specific usecase, I would recommend the following flow

  1. From Express API Get Pre-Signed URL to Upload file to S3
  2. Upload file directly to S3 from Mobile Client (Which will show the status as uploading in progress)
  3. After upload completes, S3 will trigger a SNS push notification which will be sent to the Mobile device
  4. Mobile device will read the push notification and change the uploading status in the application

Above flow is completely asynchronous and highly scalable reducing the load for your express API.

over 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