File download issues
parent
202cc1dec3
commit
17b3c5e4cd
|
|
@ -64,7 +64,12 @@ router.get("/download/:id",function(req,res){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var file = finalStorage + sermon.file;
|
var file = finalStorage + sermon.file;
|
||||||
res.download(file);
|
if (fs.existsSync(file)){
|
||||||
|
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