Download file working

This commit is contained in:
Eudes Inácio
2021-12-23 07:40:01 +01:00
parent cff5ee4322
commit 8c20b62215
7 changed files with 96 additions and 38 deletions
@@ -61,7 +61,7 @@
<div *ngIf="msg.attachments" class="message-attachments">
<div *ngFor="let file of msg.attachments let i = index">
<div (click)="downloadFileMsg(msg)">
<img *ngIf="msg.image_url" src="{{msg.image_url}}" alt="image">
<img *ngIf="msg.image_url" src={{msg.image_url}} alt="image">
</div>
<div>
<div>
+5 -2
View File
@@ -591,6 +591,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
} else {
this.sqlservice.getAllChatMSG(roomId).then((msg: any) => {
console.log('ALL MSG DBBB', msg)
let chatmsgArray = [];
let array = []
msg.forEach(element => {
@@ -606,7 +607,8 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
rid: element.Rid,
ts: element.Ts,
u: this.isJson(element.U),
_updatedAt: element.UpdatedAt
_updatedAt: element.UpdatedAt,
image_url: this.isJson(element.image_url)
}
chatmsgArray.push(msgChat)
@@ -787,11 +789,12 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
console.log('SAVED FILE WEB error ', error)
});
const readFile = await Filesystem.readdir({
const readFile = await Filesystem.readFile({
path: `${IMAGE_DIR}/${name}`,
directory: Directory.Data,
}).then((foo) => {
console.log('GET FILE WEB', foo)
});
}