react-s3-uploader
Advanced tools
Comparing version 1.1.15 to 1.1.16
{ | ||
"name": "react-s3-uploader", | ||
"version": "1.1.15", | ||
"version": "1.1.16", | ||
"description": "React component that renders a file input and automatically uploads to an S3 bucket", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -8,2 +8,3 @@ /** | ||
S3Upload.prototype.fileElement = null; | ||
S3Upload.prototype.files = null; | ||
@@ -31,8 +32,8 @@ S3Upload.prototype.onFinishS3Put = function(signResult) { | ||
} | ||
this.handleFileSelect(this.fileElement); | ||
var files = this.fileElement ? this.fileElement.files : this.files || []; | ||
this.handleFileSelect(files); | ||
} | ||
S3Upload.prototype.handleFileSelect = function(fileElement) { | ||
this.onProgress(0, 'Upload started.'); | ||
var files = fileElement.files; | ||
S3Upload.prototype.handleFileSelect = function(files) { | ||
this.onProgress(0, 'Waiting'); | ||
var result = []; | ||
@@ -119,3 +120,3 @@ for (var i=0; i < files.length; i++) { | ||
percentLoaded = Math.round((e.loaded / e.total) * 100); | ||
return this.onProgress(percentLoaded, percentLoaded === 100 ? 'Finalizing.' : 'Uploading.'); | ||
return this.onProgress(percentLoaded, percentLoaded === 100 ? 'Finalizing' : 'Uploading'); | ||
} | ||
@@ -146,2 +147,3 @@ }.bind(this); | ||
} | ||
this.httprequest = xhr; | ||
return xhr.send(file); | ||
@@ -156,3 +158,7 @@ }; | ||
S3Upload.prototype.abortUpload = function() { | ||
this.httprequest && this.httprequest.abort(); | ||
}; | ||
module.exports = S3Upload; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15333
268