     #
     # Attaches a file to the specified input field.  The second argument is the
     # file name.
-    this.attach = (selector, filename)->
+    this.attach = (selector, filename, callback)->
       field = @field(selector)
       if field && field.tagName == "INPUT" && field.type == "file"
         field.value = filename
-        @fire "change", field
+        @fire "change", field, callback
         return this
       else
         throw new Error("No file INPUT matching '#{selector}'")

    # * value -- Value (or label) or option to select
    #
    # Returns this
    this.select = (selector, value)->
      option = findOption(selector, value)
      @selectOption(option)
      return this

    # ### browser.selectOption(option) => this

    # * selector -- CSS selector, field name or text of the field label
    #
    # Returns this
    this.uncheck = (selector, callback)-> setCheckbox(selector, false, callback)

    # ### browser.choose(selector) => this
    #
