readfile
This commit is contained in:
@@ -508,8 +508,8 @@ module.exports = {
|
|||||||
reader.onload = () => {
|
reader.onload = () => {
|
||||||
resolve(reader.result);
|
resolve(reader.result);
|
||||||
};
|
};
|
||||||
reader.onerror = reject;
|
reader.onerror = reject("Error reading the file " + file.name);
|
||||||
reader.readAsText(file);
|
reader.readAsText(file, "utf-8");
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -533,7 +533,7 @@ module.exports = {
|
|||||||
const fileContent = await readFile(file);
|
const fileContent = await readFile(file);
|
||||||
console.log(fileContent);
|
console.log(fileContent);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
alert('Error reading file:', error);
|
alert("Error reading file:", error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// const extension = file.name.split(".").pop();
|
// const extension = file.name.split(".").pop();
|
||||||
|
|||||||
Reference in New Issue
Block a user