Hello,
There is any way to delete file when delete doc ??
Bests.
That answer provides some guiding, basically you want to do something like:
fs.unlink(req.file.path, (err) => /* ... */)
on my vps, after fs.unlink..... restart the app
@LinusU @adeelibr How can you expose fs.unlink in the Node / Express framework so that it can process API delete requests? Posts are exposed with an app.post(...) so is something similar needed to expose the delete request?
@NickEmpetvee do you mean app.delete(...) for processing delete request, is that what you want?
@haxer-max yeah that was what it was. I figured it out not too long after posting it. This was my first time coding with Node.
Most helpful comment
That answer provides some guiding, basically you want to do something like: