From 119930131d30d72bd7224edd9ad9e0eb8aa6da37 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Wed, 10 Feb 2016 15:23:53 -0500 Subject: [PATCH] fixed errors when uploading files --- src/controllers/uploads.js | 4 ++-- src/user/picture.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/controllers/uploads.js b/src/controllers/uploads.js index 5c04d4d483..d455eaac2f 100644 --- a/src/controllers/uploads.js +++ b/src/controllers/uploads.js @@ -46,7 +46,7 @@ uploadsController.upload = function(req, res, filesIterator, next) { uploadsController.uploadPost = function(req, res, next) { uploadsController.upload(req, res, function(uploadedFile, next) { if (uploadedFile.type.match(/image./)) { - file.isFileTypeAllowed(uploadedFile.path, function(err) { + file.isFileTypeAllowed(uploadedFile.path, function(err, tempPath) { if (err) { return next(err); } @@ -66,7 +66,7 @@ uploadsController.uploadThumb = function(req, res, next) { } uploadsController.upload(req, res, function(uploadedFile, next) { - file.isFileTypeAllowed(uploadedFile.path, function(err) { + file.isFileTypeAllowed(uploadedFile.path, function(err, tempPath) { if (err) { return next(err); } diff --git a/src/user/picture.js b/src/user/picture.js index d1d065a9be..bb3d24dd4e 100644 --- a/src/user/picture.js +++ b/src/user/picture.js @@ -38,7 +38,7 @@ module.exports = function(User) { function(next) { file.isFileTypeAllowed(picture.path, next); }, - function(next) { + function(path, next) { image.resizeImage({ path: picture.path, extension: extension,