Skip to content

Conversation

@lyyh3c
Copy link
Contributor

@lyyh3c lyyh3c commented Mar 30, 2017

to solve EISDIR error when trying to submit a form with no file selected.
When we tried to submit a form with no file selected, then part.filename is '' but not undefined. And I think fomidable should handle this situation.
We can also modify like below:
IncomingForm.prototype.onPart = function(part) {
// this method can be overwritten by the user
if (part.filename !== '') {
this.handlePart(part);
}
};

If we don't do this, then the code will go to "file.open()" (lib/incoming_form.js:215) and then it will throw EISDIR error and then our process will stop.

to solve EISDIR error when trying to submit a form with no file
selected.
@tunnckoCore
Copy link
Member

Please remove needless added .idea things and change the condition to !part.filename

lyyh3c added 2 commits March 30, 2017 23:08
remove needless .idea things and change the condition to !part.filename
remove needless .idea
@lyyh3c
Copy link
Contributor Author

lyyh3c commented Mar 30, 2017

@tunnckoCore I have removed .idea things and changed the condition to !part.filename

@tunnckoCore
Copy link
Member

Thanks! Use the master for install, because it's not sure when new release will come.

@tunnckoCore tunnckoCore merged commit 05e4743 into node-formidable:master Mar 30, 2017
@tunnckoCore tunnckoCore mentioned this pull request Mar 30, 2017
kornelski added a commit that referenced this pull request Sep 26, 2017
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.

2 participants