- 
                Notifications
    
You must be signed in to change notification settings  - Fork 25
 
Open
Description
var parse = require('co-busboy');
app.use(function* (next) {
  if (!this.request.is('multipart/*')) return yield next;
  var parts = parse(this, {
          checkFile: function (fieldname, filestream, filename) {
          if (path.extname(filename) !== '.dat') {
            return new Error('invalid filename extension');
          }
        }
   });
  var part;
try {
  while (part = yield parts) {
    if (part.length) {
      console.log('key: ' + part[0]);
      console.log('value: ' + part[1]);
    } else {
      part.pipe(fs.createWriteStream('some file.txt'))
    }
  }
catch (e) {
}
});
when upload a image file, the 'part' is FileStream instance.but it is no length method.
and then can't catch checkFile error.   my request url's status always 'pending'.
i don't know why, pls help
Metadata
Metadata
Assignees
Labels
No labels