This commit is contained in:
Peter Maquiran
2024-03-26 13:58:09 +01:00
3884 changed files with 1963136 additions and 404 deletions
+8 -5
View File
@@ -446,6 +446,8 @@ export class MessageService {
this.downloadLoader = true;
let downloadFile = "";
let downloadUrl = "";
this.AttachmentsService.downloadFile(this.file.guid).subscribe(async (event) => {
console.log('download file',event)
@@ -456,10 +458,10 @@ export class MessageService {
if (this.file.type == "application/img") {
downloadFile = 'data:image/jpeg;base64,' + btoa(new Uint8Array(event.body).reduce((data, byte) => data + String.fromCharCode(byte), ''));
} else if (this.file.type != "application/img") {
downloadFile = event.url
/*
let */
/* downloadFile = btoa(new Uint8Array(event.body).reduce((data, byte) => data + String.fromCharCode(byte), '')); */
downloadFile = btoa(new Uint8Array(event.body).reduce((data, byte) => data + String.fromCharCode(byte), ''));
downloadUrl = event.url
console.log('downloaded file', downloadFile)
console.log('event body downloaded file', event.url)
@@ -471,7 +473,8 @@ export class MessageService {
title: this.attachments[0].title,
title_link: downloadFile,
title_link_download: this.attachments[0].title_link_download,
ts: this.attachments[0].ts
ts: this.attachments[0].ts,
attachmentsUrl: downloadUrl
}
// save the changes to the storage