added a text property for the file as well
This commit is contained in:
parent
17d61fda0d
commit
6f779b215c
|
|
@ -136,15 +136,21 @@ class FilePickerWidget extends BaseWidget<
|
||||||
binaryReader.readAsBinaryString(file.data);
|
binaryReader.readAsBinaryString(file.data);
|
||||||
binaryReader.onloadend = () => {
|
binaryReader.onloadend = () => {
|
||||||
const rawData = binaryReader.result;
|
const rawData = binaryReader.result;
|
||||||
const newFile = {
|
const textReader = new FileReader();
|
||||||
id: file.id,
|
textReader.readAsText(file.data);
|
||||||
base64: base64data,
|
textReader.onloadend = () => {
|
||||||
blob: file.data,
|
const text = textReader.result;
|
||||||
raw: rawData,
|
const newFile = {
|
||||||
name: file.meta ? file.meta.name : undefined,
|
id: file.id,
|
||||||
|
base64: base64data,
|
||||||
|
blob: file.data,
|
||||||
|
raw: rawData,
|
||||||
|
text: text,
|
||||||
|
name: file.meta ? file.meta.name : undefined,
|
||||||
|
};
|
||||||
|
dslFiles.push(newFile);
|
||||||
|
this.props.updateWidgetMetaProperty("files", dslFiles);
|
||||||
};
|
};
|
||||||
dslFiles.push(newFile);
|
|
||||||
this.props.updateWidgetMetaProperty("files", dslFiles);
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user