add file on chat its hide

This commit is contained in:
Eudes Inácio
2023-08-30 20:54:47 +01:00
28 changed files with 67 additions and 79 deletions
+10 -10
View File
@@ -831,22 +831,22 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
if (file.type != "application/img" && file.type != "image/png" && file.type != "image/jpeg" && file.type != "image/gif") {
console.log(file.type)
console.log('TYPE',file.type)
const encodedData = btoa(JSON.stringify(await this.getBase64(file).catch ((error) => {
const encodedData = 'data:application/pdf;base64,'+btoa(JSON.stringify(await this.getBase64(file).catch ((error) => {
console.error(error);
})));
console.log(encodedData)
const blob = this.fileService.base64toBlob(encodedData, file.type)
console.log(blob
)
const fileBase64 = await this._getBase64(file)
console.log(fileBase64)
console.log('BLOB BLOB',blob)
/* const fileBase64 = await this._getBase64(file)
console.log('BASE&$',fileBase64) */
const formData = new FormData();
/* const formData = new FormData();
console.log('add file', formData)
formData.append('blobFile', blob);
formData.append('blobFile', blob); */
let ob = {'blobFile': blob}
this.ChatSystemService.getDmRoom(roomId).send({
file: {
@@ -859,9 +859,9 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
// "text": "description",
"title_link_download": false,
}],
temporaryData: formData,
temporaryData: ob,
attachmentsModelData: {
fileBase64: fileBase64,
fileBase64: encodedData,
}
});
} else {