blueimp/jQuery-File-Upload — Issue #964: When trying to upload a second file, it's sending the first file over
Author: dannytatom
Created: 2012-01-20 20:12:13+00:00
State: open

First image I'm uploading is **dog.jpg**. Once that is done uploading, and I try uploading **cat.jpg**, it sends **dog.jpg** over to the server. I had added `console.log(data)` to the change event, and when adding the second photo, change shows it correctly. The actual request (shown in Chrome's network tab) isn't right, though.

Here's the JS for it:

```javascript
stepOne.find('input[type=file]').fileupload({
dataType: 'json',
url: '/api/v1/pending_photos.json',
paramName: 'photo',

replaceFileInput: false,

add: function(e, data) {
stepOne.find('input[type=submit]').click(function() {
var xhr = data.submit();

xhr.success(function(data) {
var medium = data.pending_photo.medium,
small = data.pending_photo.small;

addPhotoToUI(medium);
});

return false;
});
}
});
```