Prevent file from uploading if the submit element is disabled

Added a test, and supporting code.

This is my first pull request, so any suggestions/comments accepted.

--chris