Skip to content

after enter an Error in fileFilter,it doesn't work #192

@zyf0330

Description

@zyf0330
function fileFilter (req, file, cb) {

  // The function should call `cb` with a boolean
  // to indicate if the file should be accepted

  // To reject this file pass `false`, like so:
  cb(null, false)

  // To accept the file pass `true`, like so:
  cb(null, true)

  // You can always pass an error if something goes wrong:
  cb(new Error('I don\'t have a clue!'))

}

This line within 'new Error' works not well.
Though

res.render('error', {
      message: err.message,
      error: err
    });

has been executed in app.js error handle,but the page shows it is uploading file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions