Skip to content

Instantly share code, notes, and snippets.

@anon767
Last active October 30, 2023 17:37
Show Gist options
  • Save anon767/f8afdeddedf249c221fe4233450a53ff to your computer and use it in GitHub Desktop.
Save anon767/f8afdeddedf249c221fe4233450a53ff to your computer and use it in GitHub Desktop.
API Call to securewoof
<html>
<input id="fileupload" name="fileupload" type="file" value="" />
</html>
async function uploadFile() {
let formData = new FormData();
formData.append("file", fileupload.files[0]);
const response = await fetch('https://antivir.securewoof.com', {
method: "POST",
body: formData
});
const data = await response.json()
if (data.error) {
console.log("error");
} else if (data.prediction) {
console.log(data.prediction);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment