Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-s3-uploader

Package Overview
Dependencies
Maintainers
1
Versions
59
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-s3-uploader - npm Package Compare versions

Comparing version 1.1.17 to 1.1.18

2

package.json
{
"name": "react-s3-uploader",
"version": "1.1.17",
"version": "1.1.18",
"description": "React component that renders a file input and automatically uploads to an S3 bucket",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -10,11 +10,11 @@ /**

S3Upload.prototype.onFinishS3Put = function(signResult) {
S3Upload.prototype.onFinishS3Put = function(signResult, file) {
return console.log('base.onFinishS3Put()', signResult.publicUrl);
};
S3Upload.prototype.onProgress = function(percent, status) {
S3Upload.prototype.onProgress = function(percent, status, file) {
return console.log('base.onProgress()', percent, status);
};
S3Upload.prototype.onError = function(status) {
S3Upload.prototype.onError = function(status, file) {
return console.log('base.onError()', status);

@@ -37,7 +37,7 @@ };

S3Upload.prototype.handleFileSelect = function(files) {
this.onProgress(0, 'Waiting');
var result = [];
for (var i=0; i < files.length; i++) {
var f = files[i];
result.push(this.uploadFile(f));
var file = files[i];
this.onProgress(0, 'Waiting', file);
result.push(this.uploadFile(file));
}

@@ -89,3 +89,3 @@ return result;

} catch (error) {
this.onError('Invalid signing server response JSON: ' + xhr.responseText);
this.onError('Invalid signing server response JSON: ' + xhr.responseText, file);
return false;

@@ -95,3 +95,3 @@ }

} else if (xhr.readyState === 4 && xhr.status !== 200) {
return this.onError('Could not contact request signing server. Status = ' + xhr.status);
return this.onError('Could not contact request signing server. Status = ' + xhr.status, file);
}

@@ -105,14 +105,14 @@ }.bind(this);

if (!xhr) {
this.onError('CORS not supported');
this.onError('CORS not supported', file);
} else {
xhr.onload = function() {
if (xhr.status === 200) {
this.onProgress(100, 'Upload completed.');
return this.onFinishS3Put(signResult);
this.onProgress(100, 'Upload completed', file);
return this.onFinishS3Put(signResult, file);
} else {
return this.onError('Upload error: ' + xhr.status);
return this.onError('Upload error: ' + xhr.status, file);
}
}.bind(this);
xhr.onerror = function() {
return this.onError('XHR error.');
return this.onError('XHR error', file);
}.bind(this);

@@ -123,3 +123,3 @@ xhr.upload.onprogress = function(e) {

percentLoaded = Math.round((e.loaded / e.total) * 100);
return this.onProgress(percentLoaded, percentLoaded === 100 ? 'Finalizing' : 'Uploading');
return this.onProgress(percentLoaded, percentLoaded === 100 ? 'Finalizing' : 'Uploading', file);
}

@@ -126,0 +126,0 @@ }.bind(this);

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc