Skip to content

Commit

Permalink
docs: clarify in readme the value of part.filename
Browse files Browse the repository at this point in the history
closes #207
  • Loading branch information
dougwilson committed Dec 18, 2021
1 parent 645fa95 commit 24aa0dc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,14 @@ form.on('part', function(part) {
// You *must* act on the part by reading it
// NOTE: if you want to ignore it, just call "part.resume()"

if (!part.filename) {
if (part.filename === undefined) {
// filename is not defined when this is a field and not a file
console.log('got field named ' + part.name);
// ignore field's content
part.resume();
}

if (part.filename) {
if (part.filename !== undefined) {
// filename is defined when this is a file
count++;
console.log('got file named ' + part.name);
Expand Down

0 comments on commit 24aa0dc

Please sign in to comment.