EISDIR Error
See original GitHub issueI tried to submit a form with no file selected. I get an EISDIR error.
Is there anyway to catch no file selected error
here is my code snippet
var form = new formidable.IncomingForm();
var uploadPath = [];
form.on('fileBegin', function (name, file) {
file.path = __dirname + '/upload/' + file.name;
});
form.on('file', function (name, file) {
uploadPath.push(file.name);
});
form.parse(req, function (err, fields, files) {
console.log(uploadPath)
});
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
Using Node.js I get, "Error: EISDIR, read" - Stack Overflow
EISDIR error occurs when you try to open a file, but the path given is a directory. You can fix this by checking...
Read more >Error: EISDIR: illegal operation on a directory, read · Issue #658
Error : EISDIR: illegal operation on a directory, read at Object.readSync (node:fs:625:3) at tryReadSync (node:fs:390:20) at Object.
Read more >NPM stuck giving the same error EISDIR: Illegal operation on ...
Windows : NPM stuck giving the same error EISDIR : Illegal operation on a directory, read at error (native) [ Beautify Your Computer ......
Read more >[error: eisdir: illegal operation on a directory, read] { errno ...
EISDIR stands for " Error, Is Directory ". This means that NPM is trying to do something to a file but it is...
Read more >EISDIR: illegal operation on a directory when enable Remote ...
SDK Version: 41 Platforms(Android/iOS/web/all): Android When create a new App and enable Remote Debug, the CLI throws that exception: Error: ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I met the same problem with you, and you can try like below: form.onPart = function(part) { if (‘’ != part.filename) { form.handlePart(part); } else { console.error(‘browser has not specified filename, please check it.’); } };
and I think we can also modify lib/incoming_form.js:185 in formidable (handlePart). formidable seems didn’t consider this situation. We can modify like below: if (part.filename === undefined) ===> if (part.filename === undefined || part.filename === ‘’)
I tried, the above two methods are OK.
This breaks tests