replicate download file from chat conversation mobile and web

This commit is contained in:
tiago.kayaya
2021-10-05 16:29:33 +01:00
parent db3cda5050
commit 9a629628f3
18 changed files with 252 additions and 21 deletions
@@ -0,0 +1,40 @@
import { Component, OnInit } from '@angular/core';
import { DomSanitizer } from '@angular/platform-browser';
import { ModalController, NavParams } from '@ionic/angular';
@Component({
selector: 'app-view-document',
templateUrl: './view-document.page.html',
styleUrls: ['./view-document.page.scss'],
})
export class ViewDocumentPage implements OnInit {
url: string;
a:string = "https://equilibrium.dyndns.info/FileShare/pdfjs/web/viewer.html?file=";
viewerUrl: string;
trustedUrl: any;
file:any;
constructor(
private modalController: ModalController,
private navParams: NavParams,
private sanitazer: DomSanitizer,
) {
this.file = this.navParams.get('file');
this.url = this.file.title_link;
console.log(this.url);
}
ngOnInit() {
this.viewerUrl = this.url.replace("webTRIX.Viewer.Branch1/pdfjs/web/viewpdf.aspx?file=/webTRIX.Viewer.Branch1/arq/637690403731947760.pdf&i", "FileShare/pdfjs/web/viewer.html?file");
this.trustedUrl = this.sanitazer.bypassSecurityTrustResourceUrl(this.viewerUrl);
console.log(this.trustedUrl);
}
close() {
this.modalController.dismiss();
}
}