diff --git a/s3upload.js b/s3upload.js index 2fd9915..a515356 100644 --- a/s3upload.js +++ b/s3upload.js @@ -173,7 +173,8 @@ S3Upload.prototype.uploadToS3 = function(file, signResult) { } else { xhr.setRequestHeader('x-amz-acl', 'public-read'); } - this.httprequest = xhr; + this.httpRequests = this.httpRequests || []; + this.httpRequests[file.name] = xhr; return xhr.send(file); }; @@ -184,8 +185,9 @@ S3Upload.prototype.uploadFile = function(file) { return this.executeOnSignedUrl(file, uploadToS3Callback); }; -S3Upload.prototype.abortUpload = function() { - this.httprequest && this.httprequest.abort(); +S3Upload.prototype.abortUpload = function(file) { + var httpRequest = this.httpRequests[file.name]; + httpRequest && httpRequest.abort(); };