Skip to content

Cancel/abort upload process (Feature request) #471

@xarguments

Description

@xarguments

When the lib receives files and fields, it starts to receive (upload) files in any case.
For example, I check form fields for emptiness, and reject the request. But it still accepts the files and stores them, and I can't prevent it.

form.on("field", function (name, value) {
  // Reject if a form field value is empty
  if (_.isEmpty(value)) {
    return res.sendStatus(400);
    // Want to cancel processing of the form here, but the lib continues
  }
});
form.on("file", function (name, value) {
  // And accepts the file, stores it, and reaches here
});

So in this example, if the received form consists of an empty field, and a file, its not possible to stop the file from being accepted (correct me if I've mistaken).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions