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

to solve EISDIR error #424

Merged
merged 3 commits into from
Mar 30, 2017
Merged

to solve EISDIR error #424

merged 3 commits into from
Mar 30, 2017

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

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