Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

536
Vistas
How to upload all formats of docs, Videos and see the preview of the doc using Angular

Uploaded files unable to see in the carousel, Im able to see video and image files, please suggest me to see all formats of the docs as well.

  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);
      }
    }
  }

Stackblitz

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

In the HTML template (on stackblitz) you are referencing an for the PDF document. According to documentation from Mozilla you have to add the type of document as well. So in this case (pdf) you have to specify:

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

Then the PDF gets rendered. For other types of documents you have to specify the correct type (see docs).

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda