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.14 to 1.1.15

2

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

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

@@ -16,3 +16,4 @@ "use strict";

signingUrlQueryParams: React.PropTypes.object,
uploadRequestHeaders: React.PropTypes.object
uploadRequestHeaders: React.PropTypes.object,
contentDisposition: React.PropTypes.string
},

@@ -43,3 +44,4 @@

signingUrlQueryParams: this.props.signingUrlQueryParams,
uploadRequestHeaders: this.props.uploadRequestHeaders
uploadRequestHeaders: this.props.uploadRequestHeaders,
contentDisposition: this.props.contentDisposition
});

@@ -46,0 +48,0 @@ },

@@ -26,3 +26,4 @@ react-s3-uploader

signingUrlQueryParams={{ additional: query-params }}
uploadRequestHeaders={{ 'x-amz-acl', 'public-read' }} />
uploadRequestHeaders={{ 'x-amz-acl', 'public-read' }}
contentDisposition="auto" />

@@ -34,2 +35,7 @@ The above example shows all supported `props`. For `uploadRequestHeaders`, the default ACL is shown.

`contentDisposition` is optional and can be one of `inline`, `attachment` or `auto`. If given,
the `Content-Disposition` header will be set accordingly with the file's original filename.
If it is `auto`, the disposition type will be set to `inline` for images and `attachment` for
all other files.
The resulting DOM is essentially:

@@ -36,0 +42,0 @@

@@ -122,2 +122,14 @@ /**

xhr.setRequestHeader('Content-Type', file.type);
if (this.contentDisposition) {
var disposition = this.contentDisposition;
if (disposition === 'auto') {
if (file.type.substr(0, 6) === 'image/') {
disposition = 'inline';
} else {
disposition = 'attachment';
}
}
var fileName = file.name.replace(/\s+/g, "_");
xhr.setRequestHeader('Content-Disposition', disposition + '; filename=' + fileName);
}
if (this.uploadRequestHeaders) {

@@ -124,0 +136,0 @@ var uploadRequestHeaders = this.uploadRequestHeaders;

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