This commit is contained in:
sanjayk03-dev
2024-04-05 01:48:06 +05:30
parent 526f07a746
commit 4da82a9cef

View File

@@ -508,8 +508,8 @@ module.exports = {
reader.onload = () => {
resolve(reader.result);
};
reader.onerror = reject;
reader.readAsText(file);
reader.onerror = reject("Error reading the file " + file.name);
reader.readAsText(file, "utf-8");
});
},
@@ -533,7 +533,7 @@ module.exports = {
const fileContent = await readFile(file);
console.log(fileContent);
} catch (error) {
alert('Error reading file:', error);
alert("Error reading file:", error);
}
}
// const extension = file.name.split(".").pop();