download mp3
parent
05fc3a220a
commit
2797c504b4
|
|
@ -8,7 +8,7 @@
|
||||||
<div class="description">{{ description }}</div><!--
|
<div class="description">{{ description }}</div><!--
|
||||||
--><div class="action-buttons">
|
--><div class="action-buttons">
|
||||||
<button mat-button class="action pct40" (click)="play()" ><i ofbicon>headset</i> Listen</button><!--
|
<button mat-button class="action pct40" (click)="play()" ><i ofbicon>headset</i> Listen</button><!--
|
||||||
--><button mat-button class="action pct50" (click)="download()" ><i ofbicon>file_download</i> Download</button><!--
|
--><a download="{{title}}" href="{{url}}" mat-button class="action pct50" ><i ofbicon>file_download</i> Download</a><!--
|
||||||
--><button mat-button class="action pct10" (click)="share()" ><i ofbicon>share</i> Share</button>
|
--><button mat-button class="action pct10" (click)="share()" ><i ofbicon>share</i> Share</button>
|
||||||
</div><!--
|
</div><!--
|
||||||
--><div class="action-buttons" *ngIf="loggedIn">
|
--><div class="action-buttons" *ngIf="loggedIn">
|
||||||
|
|
|
||||||
|
|
@ -64,14 +64,11 @@ router.get("/download/:id",function(req,res){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var file = finalStorage + sermon.file;
|
var file = finalStorage + sermon.file;
|
||||||
console.log(file);
|
if (fs.existsSync(file)){
|
||||||
file = 'https://static.danabsher.com/media/' + sermon.file;
|
|
||||||
res.download(file);
|
res.download(file);
|
||||||
// if (fs.existsSync(file)){
|
} else {
|
||||||
// res.download(file);
|
res.status(404).json({"status":404,"message":"Could not find the file associated with this sermon"});
|
||||||
// } else {
|
}
|
||||||
// res.status(404).json({"status":404,"message":"Could not find the file associated with this sermon"});
|
|
||||||
// }
|
|
||||||
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue