Skip to content

Commit 44f5b6a

Browse files
committed
Add option to change when the signed upload URL expires
1 parent e372cf5 commit 44f5b6a

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ app.use('/s3', require('react-s3-uploader/s3router')({
118118
bucket: "MyS3Bucket",
119119
region: 'us-east-1', //optional
120120
signatureVersion: 'v4', //optional (use for some amazon regions: frankfurt and others)
121+
signatureExpires: 60, //optional, number of seconds the upload signed URL should be valid for (defaults to 60)
121122
headers: {'Access-Control-Allow-Origin': '*'}, // optional
122123
ACL: 'private', // this is default
123124
uniquePrefix: true // (4.0.2 and above) default is true, setting the attribute to false preserves the original filename in S3

s3router.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ function S3Router(options, middleware) {
9090
var params = {
9191
Bucket: S3_BUCKET,
9292
Key: fileKey,
93-
Expires: 60,
93+
Expires: options.signatureExpires || 60,
9494
ContentType: mimeType,
9595
ACL: options.ACL || 'private'
9696
};

0 commit comments

Comments
 (0)