By having these simple few lines of code I've got file saved on server.
router.post('/upload', upload.single('file'), function(req: Request, res: Response, next: Function) {
console.log(req.file);
res.json({ success: true, message: 'Uploaded' });
});
I want to encrypt the file before it is get saved.
Is there any way I can do that?
control over your file uploads.
Therefore, the order of execution is:
onParseEnd
So,in your case your encrypting proccess should be in onFileUploadComplete by doing something like this: