send every type of file its possible now

This commit is contained in:
Eudes Inácio
2022-04-06 16:25:47 +01:00
parent 74a9b787e9
commit a998bee230
8 changed files with 283 additions and 179 deletions
+5 -3
View File
@@ -233,15 +233,17 @@ export class MessageService {
} else if (event.type === HttpEventType.Response) {
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/pdf') {
} else if (this.file.type != "application/img") {
downloadFile = new Uint8Array(event.body).reduce((data, byte) => data + String.fromCharCode(byte), '');
console.log(downloadFile)
} else if (this.file.type == 'application/audio') {
} /* else if (this.file.type == 'application/audio') {
downloadFile = new Uint8Array(event.body).reduce((data, byte) => data + String.fromCharCode(byte), '');
} else if (this.file.type == 'application/vnd.openxmlformats-officedocument.wordprocessingml.document') {
downloadFile = new Uint8Array(event.body).reduce((data, byte) => data + String.fromCharCode(byte), '');
}
} */
console.log('Download file ',downloadFile )
this.attachments[0] = {
image_url: downloadFile,