0
I am working with uploading XML in Angular 4. I would need to read the contents of this file and turn into a string.
Could someone help me ?
HTML
<input id="uploadXml" type="file"
#uploadXml
accept='text/xml'
(change)="handleXmlFile(uploadXml)">
Javascript
handleXmlFile(_uploadXml){
this.file = _uploadXml.files[0];
}
Try File API, as in this example I did in pure JS: https://answall.com/a/117499/3635, it is not complicated to convert to Typescript
– Guilherme Nascimento