From 4cc0192301c33f7b19b2b258eb3be55906844d6d Mon Sep 17 00:00:00 2001 From: Kevin Reilly Date: Sat, 31 Dec 2022 20:09:26 -0800 Subject: [PATCH] fix: 'os.tmpDir is not a function' on recent Node versions --- samples/photo_album/controllers/photos_controller.js | 2 +- samples/photo_album/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/photo_album/controllers/photos_controller.js b/samples/photo_album/controllers/photos_controller.js index 376eabcf..6aad09b4 100644 --- a/samples/photo_album/controllers/photos_controller.js +++ b/samples/photo_album/controllers/photos_controller.js @@ -33,7 +33,7 @@ function create_through_server(req, res) { // and then saved to the database. // file was not uploaded redirecting to upload - if (req.files.image.ws.bytesWritten === 0) { + if (req.files.image.size === 0) { res.redirect('/photos/add'); return; } diff --git a/samples/photo_album/package.json b/samples/photo_album/package.json index 3c2aec03..e043f7f0 100644 --- a/samples/photo_album/package.json +++ b/samples/photo_album/package.json @@ -11,8 +11,8 @@ "dependencies": { "body-parser": "^1.5.2", "cloudinary": "^1.3.0", - "connect-multiparty": "^1.1.0", "cloudinary-jquery-file-upload": "^2.0.1", + "connect-multiparty": "^2.2.0", "dotenv": "^0.4.0", "ejs": "^3.1.6", "ejs-locals": "^1.0.2",