Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Unexpected events order for multi-files forms #261

timotheeg opened this Issue · 3 comments

2 participants


If a form has 2 sequential files, file1 and file2, I expect the "fileBegin" and "file" events to be fired in the order below (because it matches the payload content):

  1. fileBegin file1
  2. file file1
  3. fileBegin file2
  4. file file2

Instead, the events are fired in this order:

  1. fileBegin file1
  2. fileBegin file2
  3. file file1
  4. file file2

This is problematic because if I decide that file2 must be rejected (e.g. forbidden mime type), the connection destroyed, and all listeners removed from my form for cleanup, then it means I do not receive the "file" event for file1.

I do not have a fix yet, but I have made a test to demonstrate the issue in a commit in my fork:



@felixge felixge closed this
@felixge felixge reopened this

The joys of async! This is the expect behavior at this point, but arguably not the most convenient. Feel free to propose a patch, but IMO you can use async control flow techniques to deal with it inside your app.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.