Update download location
parent
6fb5e5b27c
commit
05fc3a220a
|
|
@ -65,11 +65,13 @@ router.get("/download/:id",function(req,res){
|
||||||
}
|
}
|
||||||
var file = finalStorage + sermon.file;
|
var file = finalStorage + sermon.file;
|
||||||
console.log(file);
|
console.log(file);
|
||||||
if (fs.existsSync(file)){
|
file = 'https://static.danabsher.com/media/' + sermon.file;
|
||||||
res.download(file);
|
res.download(file);
|
||||||
} else {
|
// if (fs.existsSync(file)){
|
||||||
res.status(404).json({"status":404,"message":"Could not find the file associated with this sermon"});
|
// res.download(file);
|
||||||
}
|
// } else {
|
||||||
|
// res.status(404).json({"status":404,"message":"Could not find the file associated with this sermon"});
|
||||||
|
// }
|
||||||
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue