const onSubmitHandler = async (e) => {
e.preventDefault();
// Handle File Data from the state Before Sending
const data = new FormData();
data.append("attachment", fileData);
fetch("http://localhost:5000/api/assignment/single", {
method: "POST",
body: data,
})
.then((result) => {
console.log("File Sent Successful");
})
.catch((err) => {
console.log(err.message);
});
};