Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

214
Vistas
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?

about 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

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.

about 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda