add and view docments on chat solved

This commit is contained in:
Equilibrium ITO
2024-03-14 09:10:17 +01:00
parent 5b7224dbd6
commit 8cb9961bad
19 changed files with 230 additions and 25 deletions
+1 -1
View File
@@ -68,7 +68,7 @@ export class AttachmentsService {
downloadFile(guid: any) {
let downloadUrl = environment.apiURL + 'objectserver/StreamChatFiles?path=' + guid;
let downloadUrl = environment.apiURL + 'objectserver/streamfiles?path=' + guid;
var name = new Date().getTime();
return this.http.get(downloadUrl, {
responseType: "arraybuffer",
+2 -2
View File
@@ -456,12 +456,12 @@ 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 = new Uint8Array(event.body).reduce((data, byte) => data + String.fromCharCode(byte), '');
downloadFile = event.url
/*
let */
/* downloadFile = btoa(new Uint8Array(event.body).reduce((data, byte) => data + String.fromCharCode(byte), '')); */
console.log('downloaded file', downloadFile)
console.log('event body downloaded file', event.body)
console.log('event body downloaded file', event.url)
}