Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

213
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!