diff --git a/README.md b/README.md index b967fbd..ab56abb 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,8 @@ var Upload = require('s3-uploader'); * string `awsBucketUrl` - publicly accessible url to your bucket * string `awsBucketPath` - path within your bucket (ex. "/images") * string `awsBucketAcl` - default ACL for uploded images + * number `awsMaxRetries` - max number of retries; default 3 + * number `awsHttpTimeout` - inactive time (ms) beofre timing out; default 1000 * number `resizeQuality` - default resize quallity * boolean `returnExif` - return exif data for original image * string `tmpDir` - directory to store temporary files diff --git a/src/index.coffee b/src/index.coffee index def36d9..918e08b 100644 --- a/src/index.coffee +++ b/src/index.coffee @@ -9,7 +9,11 @@ rand = require('crypto').pseudoRandomBytes Upload = module.exports = (awsBucketName, opts) -> throw new Error 'Bucket name can not be undefined' if not awsBucketName - @s3 = new S3 params: Bucket: awsBucketName + @s3 = new S3 + maxRetries: opts?.awsMaxRetries or 3 + sslEnabled: true + httpOptions: timeout: opts?.awsHttpTimeout or 1000 + params: Bucket: awsBucketName @versions = opts?.versions or []