Just want simple file upload functionality . I have used fs-path that serves my purpose of creating dynamic folder structure and file at upload location. I am not able to achieve streaming of request file, that will have to be uploaded. My code is as follows :
fsPath.writeFile(path, **req.body**, function (err) {
if (err) {
throw err;
} else {
console.log('File Upload successful...');
res.send({ code: 200, message: `File Upload successful` });
}
});
Need some insights about, how can I send request file as input in the above code snippet. How do I steam my request file, that will be written in respective upload location?