I need to import an excel file and store that in the local folder inside the project repo.
Code:
function ImportTemplate() {
const [selectedFile, setSelectedFile] = useState();
const [isFilePicked, setIsFilePicked] = useState(false);
const changeHandler = (event) => {
setSelectedFile(event.target.files[0]);
setIsFilePicked(true);
};
return (
<div style={{ backgroundColor: "red", height: "100vh" }}>
<input type="file" name="file" onChange={changeHandler} />
</div>
);
}
The above allows you to import the excel sheet but not save it locally.