From dcca51f17c424817d613043bb6927ec0d30e6bf5 Mon Sep 17 00:00:00 2001 From: Ambrose Chua Date: Mon, 7 Nov 2016 19:13:22 +0800 Subject: [PATCH] Attempt to clear buffers --- README.md | 1 + index.js | 2 ++ 2 files changed, 3 insertions(+) diff --git a/README.md b/README.md index 8b84169..77fc27f 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,7 @@ A basic node.js file manager. - [x] Folder creation - [x] File uploads - [ ] Bulk file uploads + - [ ] Large file uploads (sharded) - [ ] File/folder renaming - [x] Bulk file/folder selection - [x] Delete diff --git a/index.js b/index.js index 08d51fa..760b39c 100644 --- a/index.js +++ b/index.js @@ -193,6 +193,7 @@ app.post("/*@upload", (req, res) => { }); stream.on("end", () => { buff = Buffer.concat(buffs); + buffs = null; }); } }); @@ -226,6 +227,7 @@ app.post("/*@upload", (req, res) => { req.flash("success", "File saved. Warning: empty file."); } else { + buff = null; req.flash("success", "File saved. "); } res.redirect("back");