Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- app.post('/remove-image', (req, res)=>{
- const imageTitle = req.body.imageTitle;
- const userid = req.body.userid;
- const fileMain = './public/media/'+userid+'/'+imageTitle;
- fs.exists(fileMain, function(exists) {
- if(exists) {
- fs.unlink(fileMain);
- }
- });
- return res.json({
- access:'ok'
- })
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement