Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 138279

How to load pdf file with angular

$
0
0

Am having troubles loading the pdf file and sending it the api (backend)

getFileUrl(event) {
        var file = event.target.files[0];
        var myReader: FileReader = new FileReader();
        myReader.onloadend = (e) => {
            let res = myReader.result;
            let formData = new FormData();
            formData.append("formFile", file);
        }
        myReader.readAsArrayBuffer(file);
    }
<input type="file" hidden #fileUpload (change)="getFileUrl($event)" /><mat-icon (click)="fileUpload.click()"> attach_file </mat-icon> 

Viewing all articles
Browse latest Browse all 138279

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>