fileSuccess event can fire before the upload is actually complete

This is a re-implementation of PR #96 on the reformatted branch to make it easier to merge.