Add file download link in files page

This commit is contained in:
Zaid Abdulla committed 2021-02-08 15:02:40 -08:00
1 parent e9a4676f5c
commit 540898de21
3 files changed
+38

No files matched your search

+5
View File
@@ -315,6 +315,11 @@ export function deleteUser(id: string): Promise<void> {
return deleteResource("users", id);
}
export function downloadFile(filename: string): Readable {
const bucket = new GridFSBucket(db);
return bucket.openDownloadStreamByName(filename);
}
export function putFile(
filename: string,
metadata: Record<string, string>,