expressjs/multer — pull request #45 by maxcnunes (2014-07-08 17:42:59+00:00)
Title: Fixed problem when uploading small files

I have changed to pass the control to the next middleware in stack only if the read and write stream are finished.

The reason to do that is because I had some problems when uploading a small file (e.g. less than 50kb).
Apparently was reading so fast that was passing to the next middleware in the stack even before the files was really saved in the hard disk.

Therefore is only going to consider finished if the read is finished and all files was already processed.