23/resumable.js — pull request #69 by stu-blair (2013-07-01 21:05:30+00:00)
Title: Fixed issue with single-file uploaders where one is unable to change what file is first added 

Problem:
I noticed some buggy behavior when using resumable.js with a single-file uploader (setting MaxFiles=1 and calling addBrowse on an input element with no 'multiple' attribute):
* If you add a file to the input, and then click and pick a file again (can even be the same file), resumable.js issues the alert "Please upload 1 file at a time." and doesn't change the selected file.
* This is because resumable.js thinks you are trying to add a second file instead of realizing that you are selecting a new file to replace the one you picked the first time.
* Resumable.js should instead imitate the native behavior of the HTML input[type='file'] element (when there is no 'multiple' attribute) and replace the currently selected file with the newly selected file.

Solution:
* In appendFilesFromFileList(), before throwing an error about adding too many files, check if maxFiles is set to 1, you have one file already added, and you are trying to add one new file. If so, replace the file already added with the new file by removing the existing file from $.files and allowing the new file to be added as normal.