Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inject the formidable "form" to the "multipartHandler" and "multipartFileHandler" functions #1871

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Iran-110
Copy link

Pre-Submission Checklist

  • Opened an issue discussing these changes before opening the PR
  • Ran the linter and tests via make prepush
  • Included comprehensive and convincing tests for changes

Issues

Closes:

Having access to the formidable form in the multipartHandler and multipartFileHandler is crucial to handle the request and incoming form easily.

Changes

In this pull request, the only change is the injection of formidable form to the multipartHandler and multipartFileHandler functions as the third argument.

This give us the ability to call form.handlePart(part) inside the customized functions. It's useful when the user wants to restrict input files to some extensions e.g. png/jpg/jpeg etc. As a result, when the part.mime would be acceptable, the user can continue the process by calling form.handlePart(part).

Injecting formidable `form` to `multipartHandler` and `multipartFileHandler` functions as the third argument can give us the ability to call `form.handlePart(part)` inside the customized functions. It's useful when the user wants to restrict input files to some extensions e.g. png/jpg/jpeg etc. As a result, when the `part.mime` would be acceptable, the user can continue the process.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant