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

317
Views
aspnet core mvc, how to preview any type of file in html?

I am using aspnet core mvc dotnet version 6.

I do an file upload page. In this page, I must show files before upload. I can preview pdfs and text files in iframe. But I want also preview docx or excell files. How can i do that?

Here is my js method:

function PreviewFiles() {
        console.log("Dosyalar yükleniyor...");
        console.log("Dosyalar ön izlemeye alınıyor...");

        var files = document.getElementById("FilesToUpload").files;
        console.log(files);
        var fileUrl = URL.createObjectURL(files[0]);
        $("#FilePreviewFrame").attr('src', fileUrl);
        $("#FilePreviewFrame").attr('height', "500");
        formData = new FormData();
        console.log("Dosyalar formdata elemanına kaydediliyor...");

        for (var i = 0; i !== files.length; i++) {
            formData.append("files", files[i]);
        }

    }

Note: Like i said, i can preview pdf and text files. I need to preview ms office documents.

about 4 years ago · Juan Pablo Isaza
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!