I've seen many examples making use of
<input type="file" id="file"/>
and then something like
let $img: any = document.querySelector('#file');
if (typeof (FileReader) !== 'undefined') {
let reader = new FileReader();
reader.onload = (e: any) => {
this.pdfSrc = e.target.result;
};
reader.readAsArrayBuffer($img.files[0]);
}
However, I know the file path and I just want to get that without any user interaction. In the example, $img.files[0] is a Blob, so it would seem that I would need to create a new Blob or File object from my known file path, but I can't figure out how to do that. I do not want to create a new file, just an object from the existing file. I would think this would be quite straight-forward, so I'm hoping I'm just missing something easy. Thanks!