anacronw / multer-s3

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

How to get success or error response after upload is done ? #130

Closed chanakaDe closed 3 years ago

chanakaDe commented 4 years ago

@badunk I have this issue. I'm using following code as you have mentioned.

app.post('/upload', upload.array('upl',1), (req, res, next) => {
    // console.log(req.file.location);
    res.send("UPLOADED");
});

I need to take a response (error or success) based on the response from S3. How can I do that ? Specially I need to check the error if exists.

Please help me.

LinusU commented 3 years ago

If any errors exists they will be passed to your Express error handler, so if you reach res.send("UPLOADED") you know that there were no errors...