-1
我正在使用angular2并试图获取上传文件.CSV文件的数据,但我无法获取文件的数据。以下是我的代码在angular2上传文件时无法获取文件数据
HTML
<input type="file" name="File Upload" id="txtFileUpload"
(change)="changeListener($event)"
accept=".csv"/>
组件
changeListener(fileInput: any): void {
debugger;
//want to get the data of the uploaded file
}
[如何上传CSV文件并使用angular2读取它们?](https://stackoverflow.com/questions/45441962/how-to-upload-a-csv-file-and-read -them-using-angular2) –
[Angular2文件输入onchange]的可能重复(https://stackoverflow.com/questions/38476315/angular2-file-input-onchange) –
博客没有给我提供答案,我是试图改变问题并提出问题,某人给出的答案不是读取要在特定位置上载文件的文件。我不想上传CSV文件,我想读取上传的.CSV文件并获取数据 –