ngx-wapp-components 3.2.13-alpha.7 → 3.2.13-alpha.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10063,6 +10063,9 @@ class WFileUploaderComponent {
10063
10063
  else if (this.fileSelected.name.endsWith('.pdf')) {
10064
10064
  this.readPDF();
10065
10065
  }
10066
+ else if (this.fileSelected.name.endsWith('.pfx') || this.fileSelected.name.endsWith('.cer')) {
10067
+ this.readFile();
10068
+ }
10066
10069
  }
10067
10070
  }
10068
10071
  onMessagesClosed(event) {
@@ -10108,6 +10111,18 @@ class WFileUploaderComponent {
10108
10111
  this.onErrorHandler.emit(err);
10109
10112
  });
10110
10113
  }
10114
+ readFile() {
10115
+ this.fileToBase64(this.fileSelected)
10116
+ .then((b64) => {
10117
+ this.base64FileData.name = this.sanitizeFileName(this.fileSelected.name);
10118
+ this.base64FileData.base64 = b64;
10119
+ this.base64FileData.type = this.fileSelected.type.split('/')[1];
10120
+ this.onFileData.emit(this.base64FileData);
10121
+ })
10122
+ .catch((err) => {
10123
+ console.error('Error convirtiendo archivo:', err);
10124
+ });
10125
+ }
10111
10126
  sanitizeFileName(name) {
10112
10127
  name = name
10113
10128
  .normalize('NFD')