-
-
Notifications
You must be signed in to change notification settings - Fork 683
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
Support the contentType of multipart field. #974
Comments
const form = formidable({
uploadDir: storagePath,
createDirsFromUploads: true,
keepExtensions: true,
});
form.onPart = function (part) {
log.info('part:', part)
if (part.mimetype && !(part as any).headers['content-disposition']?.match(/filename="/)) {
// we want it to be a "field" (cf https://github.com/node-formidable/formidable/issues/875 )
part.mimetype = null
}
form._handlePart(part);
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Support plan
Enterprise):Community
Context
What problem are you trying to solve?
If the 'Content-Type' was set,
formidable
wil parse the field as file.raw data:
result:
As you can see, when I set the contentType of field named peerUid(text/plain), it will be parsed as file.
Maybe we can just supprt the contentType text and file.
Do you have a new or modified API suggestion to solve the problem?
The text was updated successfully, but these errors were encountered: