-
-
Save AbdulKabia/c473b26cc40a3be9e0ce85ac3623ca06 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
router.post("/upload/", upload.single("userFile"), function (req, res, next) { | |
var userMessage = ""; | |
if (req.file) { | |
var fileDir = req.file.path; | |
fileside.getFileKb(fileDir, function (err, result) { | |
if (err) { | |
throw err; | |
} | |
arr1.push(result); | |
console.log(result); | |
}); | |
fileside.getFileBytes(fileDir, function (err, result) { | |
if (err) { | |
throw err; | |
} | |
arr1.push(result); | |
console.log(result); | |
}); | |
algorithms.forEach(function (value) { | |
fileside.fileHash(fileDir, value, function (err, result) { | |
if (err) { | |
throw err; | |
} | |
arr1.push(value + ": " + result); | |
console.log(value + ": " + result); | |
}); | |
}); | |
res.render("index", { | |
title: "Fileside", | |
stats: arr1 | |
}); | |
} else { | |
userMessage = "File was not recieved"; | |
res.render("upload", { | |
message: userMessage | |
}); | |
} | |
arr1 = []; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment