react-s3-uploader
Advanced tools
Comparing version 1.1.7 to 1.1.8
{ | ||
"name": "react-s3-uploader", | ||
"version": "1.1.7", | ||
"version": "1.1.8", | ||
"description": "React component that renders a file input and automatically uploads to an S3 bucket", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -54,3 +54,5 @@ react-s3-uploader | ||
### Boto for Python, in a Django project | ||
### Other Types of Servers | ||
##### Boto for Python, in a Django project | ||
@@ -75,2 +77,6 @@ import boto | ||
return HttpResponse(json.dumps({'signedUrl': signed_url})) | ||
return HttpResponse(json.dumps({'signedUrl': signed_url})) | ||
##### Other Servers | ||
If you do some work on another server, and would love to contribute documentation, please send us a PR! |
@@ -8,6 +8,13 @@ | ||
function checkTrailingSlash(path) { | ||
if (path && path[path.length-1] != '/') { | ||
path += '/'; | ||
} | ||
return path; | ||
} | ||
function S3Router(options) { | ||
var S3_BUCKET = options.bucket, | ||
getFileKeyDir = options.getFileKeyDir || function() { return "."; }; | ||
getFileKeyDir = options.getFileKeyDir || function() { return ""; }; | ||
@@ -27,3 +34,3 @@ if (!S3_BUCKET) { | ||
Bucket: S3_BUCKET, | ||
Key: getFileKeyDir(req) + '/' + req.params[0] | ||
Key: checkTrailingSlash(getFileKeyDir(req)) + req.params[0] | ||
}; | ||
@@ -30,0 +37,0 @@ var s3 = new aws.S3(); |
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
11636
206
81