Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

530
Views
Cómo cargar todos los formatos de documentos, videos y ver la vista previa del documento usando Angular

Los archivos cargados no se pueden ver en el carrusel, puedo ver archivos de video e imagen, sugiérame que vea todos los formatos de los documentos también.

 mydata = [] onSelectFile(event) { const files = event.target.files; if (files) { for (const file of files) { const reader = new FileReader(); reader.onload = (e: any) => { if (file.type.indexOf("image") > -1) { this.mydata.push({ url:e.target.result, type: 'img' }); } else if (file.type.indexOf("video") > -1) { this.mydata.push({ url:e.target.result, type: 'video' }); }else if (file.type.indexOf("ppt") > -1) { this.mydata.push({ url:e.target.result, type: 'ppt' }); } }; reader.readAsDataURL(file); } } }

apilar

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

En la plantilla HTML (en stackblitz) hace referencia a un documento PDF. De acuerdo con la documentación de Mozilla, también debe agregar el tipo de documento. Así que en este caso (pdf) tienes que especificar:

 <object *ngIf="list.type == 'pdf'" [data]="list.url" type="application/pdf"></object>

Luego se renderiza el PDF. Para otros tipos de documentos, debe especificar el tipo correcto (ver documentos).

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!