mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-30 18:46:01 +01:00
fixed errors when uploading files
This commit is contained in:
@@ -46,7 +46,7 @@ uploadsController.upload = function(req, res, filesIterator, next) {
|
|||||||
uploadsController.uploadPost = function(req, res, next) {
|
uploadsController.uploadPost = function(req, res, next) {
|
||||||
uploadsController.upload(req, res, function(uploadedFile, next) {
|
uploadsController.upload(req, res, function(uploadedFile, next) {
|
||||||
if (uploadedFile.type.match(/image./)) {
|
if (uploadedFile.type.match(/image./)) {
|
||||||
file.isFileTypeAllowed(uploadedFile.path, function(err) {
|
file.isFileTypeAllowed(uploadedFile.path, function(err, tempPath) {
|
||||||
if (err) {
|
if (err) {
|
||||||
return next(err);
|
return next(err);
|
||||||
}
|
}
|
||||||
@@ -66,7 +66,7 @@ uploadsController.uploadThumb = function(req, res, next) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
uploadsController.upload(req, res, function(uploadedFile, next) {
|
uploadsController.upload(req, res, function(uploadedFile, next) {
|
||||||
file.isFileTypeAllowed(uploadedFile.path, function(err) {
|
file.isFileTypeAllowed(uploadedFile.path, function(err, tempPath) {
|
||||||
if (err) {
|
if (err) {
|
||||||
return next(err);
|
return next(err);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ module.exports = function(User) {
|
|||||||
function(next) {
|
function(next) {
|
||||||
file.isFileTypeAllowed(picture.path, next);
|
file.isFileTypeAllowed(picture.path, next);
|
||||||
},
|
},
|
||||||
function(next) {
|
function(path, next) {
|
||||||
image.resizeImage({
|
image.resizeImage({
|
||||||
path: picture.path,
|
path: picture.path,
|
||||||
extension: extension,
|
extension: extension,
|
||||||
|
|||||||
Reference in New Issue
Block a user