PDF file upload without using input type "file" from browse

I am trying to upload a local file which I have the URL. I can upload the file from the browse button. The event.target.files from html gets me the file in a FileList and I can upload this in a new FormData() I append the file and POST the request this is working.

I want to change the implementation to picking the URL and appending the in the FormData().

I tried reading the file in array or asURL but this is not working.

I do not want to use FileTransfer cause I have some signature problem while signing for the post call. Any help?

This is what is looks like for file URL

private readFile(file: any) {
const reader = new FileReader();
reader.onloadend = () => {
const formData = new FormData();
const imgBlob = new Blob([reader.result], {type: file.type});
formData.append(‘file’, imgBlob, file.name);
// logic to upload file
error => { }