Angular 7: How to identify the Encounter of a File?

Asked

Viewed 142 times

-1

I have a function that runs when uploading files, I would like to identify the type of this Encounter. I am using the code below.

async uploadFile(event) {
    var document;
    var reader = new FileReader();
    let file = event.target.files[0];

    reader.onload = ((file: any) => {
      return (e: any) => {
        document.description = e.srcElement.result;
        document.title = title;
        document.fileName = file.name;
      }
    })(file);

    reader.readAsText(file);
  }

Any idea ?

Thank you.

1 answer

2


Browser other questions tagged

You are not signed in. Login or sign up in order to post.