upload file on chat its done

This commit is contained in:
Eudes Inácio
2023-08-31 13:07:52 +01:00
parent 081fe8692c
commit 36bd1fb6a1
6 changed files with 31 additions and 26 deletions
@@ -820,9 +820,6 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
console.error(error);
})));
const blob = this.fileService.base64toBlob(encodedData, file.type)
const fileBase64 = await this._getBase64(file)
const formData = new FormData();
formData.append('blobFile', blob);
@@ -841,7 +838,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
}],
temporaryData: formData,
attachmentsModelData: {
fileBase64: fileBase64
fileBase64: encodedData
}
});
@@ -1084,7 +1081,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
}
async openFile(pdfString, filename, type) {
const blob = this.b64toBlob(pdfString, 'application/pdf')
const blob = this.b64toBlob(pdfString, type)
let pathFile = ''
const fileName = filename
const contentFile = blob
@@ -1097,7 +1094,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
await Filesystem.writeFile({
path: fileName,
data: pdfString,
directory: Directory.Documents,
directory: Directory.Data,
}).then((dir) => {
console.log('DIR ', dir)
this.fileOpener