Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

534
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda