From 05fc3a220a2db133e088f06acd86f6ca9f47db76 Mon Sep 17 00:00:00 2001 From: dan Date: Tue, 27 Oct 2020 15:29:15 -0600 Subject: [PATCH] Update download location --- Server/src/routes/api/sermons.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Server/src/routes/api/sermons.js b/Server/src/routes/api/sermons.js index 961e28f..42d9cc6 100644 --- a/Server/src/routes/api/sermons.js +++ b/Server/src/routes/api/sermons.js @@ -65,11 +65,13 @@ router.get("/download/:id",function(req,res){ } var file = finalStorage + sermon.file; console.log(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"}); - } + file = 'https://static.danabsher.com/media/' + 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"}); + // } }); });