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.onloadend = () => {
|
||||
const rawData = binaryReader.result;
|
||||
const newFile = {
|
||||
id: file.id,
|
||||
base64: base64data,
|
||||
blob: file.data,
|
||||
raw: rawData,
|
||||
name: file.meta ? file.meta.name : undefined,
|
||||
const textReader = new FileReader();
|
||||
textReader.readAsText(file.data);
|
||||
textReader.onloadend = () => {
|
||||
const text = textReader.result;
|
||||
const newFile = {
|
||||
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