CÓDIGO:
var upload = multer({dest:"./uploads"}); app.post("/", upload.single("file"), function (req, res, next) { res.send(req.file.fileSize+"bytes"); });ARCHIVO EJS:
<h1>Get the File Size of your Upload !</h1> <form enctype="multipart/form-data" method="post" action="/" name="file"> <input type="file" class="form-control"> <button type = "submit" class = "btn btn-default">Submit</button> </form>PREGUNTA:
Qué he hecho mal ?
Agregar nombre = 'archivo' a la entrada
<h1>Get the File Size of your Upload !</h1> <form enctype="multipart/form-data" method="post" action="/"> <input type="file" class="form-control" name="file"> <button type = "submit" class = "btn btn-default">Submit</button> </form>