'DevExtreme file upload - get file content in component
I want to upload a file using DevExtreme dxFileUploader and process its content in component (not using service url).
I am using Angular 8.2.2 and DevExtreme 19.1. I have tried processing the file with onValueChange event but I only get file's attributes (file name, file size etc.) not the content itself.
app.component.html:
<dx-file-uploader #fileUploader (onValueChanged)="processFile($event)"
[multiple]="false" accept="*" [(value)]="value" uploadMode="useButtons">
</dx-file-uploader>
app.component.ts:
public value: any[] = [];
processFile(e) {
console.log(this.value); // shows only file attributes
}
Is there a way to get access to the file content from dxFileUploader control?
Solution 1:[1]
processFile(e) {
console.log(e.value[0]);
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Danon |
