mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
download files
This commit is contained in:
@@ -1400,8 +1400,6 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
a.href = url;
|
||||
a.download = fileName; // Set the desired file name
|
||||
|
||||
// Programmatically click the <a> element to trigger the download
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
} else {
|
||||
const link = document.createElement("a")
|
||||
@@ -1418,8 +1416,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
this.openViewDocumentModal(msg);
|
||||
}
|
||||
|
||||
openFile(pdfString, filename, type) {
|
||||
const blob = this.b64toBlob(pdfString, type)
|
||||
openFile(blob: Blob, filename, type) {
|
||||
let pathFile = ''
|
||||
const fileName = filename
|
||||
const contentFile = blob
|
||||
@@ -1429,8 +1426,6 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
pathFile = this.file.externalRootDirectory
|
||||
}
|
||||
|
||||
|
||||
|
||||
this.file
|
||||
.writeFile(pathFile, fileName, contentFile, { replace: true })
|
||||
.then(success => {
|
||||
|
||||
Reference in New Issue
Block a user