1

i am working with file upload and preview in angular 8.. i am able to preview word doc, image and pdf but not able to preview excel doc.. how can i do that.. i have tried with ngx-doc-viewer

preview(files) {
        if (files.length === 0)
            return;

        var mimeType = files[0].type;
        //if (mimeType.match(/image\/*/) == null) {
        //    this.message = "Only images are supported.";
        //    return;
        //}

        var reader = new FileReader();
        this.imagePath = files;
        reader.readAsDataURL(files[0]);
        reader.onload = (_event) => {
            this.imgURL = reader.result;
            this.myModel.show();
        }
    }



     <ngx-doc-viewer [url]="imgURL" viewer="mammoth"></ngx-doc-viewer>
  • Can you tell me how you display word document? To display does this deployed on hosting? do I display the word doc from the local server? I am using .net core and angular. – Void Nov 10 '20 at 07:53
  • @Void from local server u can do.. – neethu vijayan Mar 22 '21 at 06:58
  • @neethuvijayan how did you achieve doc file preview? I am doing the same but it says me every time `Your client issued a request that was too large. That’s all we know.` – Fahad Subzwari Jun 28 '21 at 23:01
  • @neethuvijayan if you have any working example using this `ngx-doc-viewer` so do let me know. I am unable to achieve. Please see my question here https://stackoverflow.com/questions/68166751/why-ngx-doc-viewer-is-not-displaying-pdf-filefile-is-on-local-disk-in-angular1 – Fahad Subzwari Jun 29 '21 at 10:31

0 Answers0