Refactor click handlers on upload button.

closes #2028
- Instead of binding and unbinding the click event, bind the data to the
  outer scope so we can use a standard click handler.