Comparing version 4.1.0 to 4.1.1
@@ -0,1 +1,7 @@ | ||
### 4.1.1 | ||
* `uploadFile` and `uploadDir` now have optional argument `defaultContentType`. | ||
* Fixes default Content-Type able to be mutated by third party modules | ||
changing the global `mime.default_type` variable. | ||
### 4.1.0 | ||
@@ -2,0 +8,0 @@ |
@@ -124,3 +124,4 @@ var AWS = require('aws-sdk'); | ||
if (s3Params.ContentType === undefined) { | ||
s3Params.ContentType = mime.lookup(localFile); | ||
var defaultContentType = params.defaultContentType || 'application/octet-stream'; | ||
s3Params.ContentType = mime.lookup(localFile, defaultContentType); | ||
} | ||
@@ -762,4 +763,4 @@ var fatalError = false; | ||
localFile: null, | ||
localFileStat: null, | ||
s3Params: baseUpDownS3Params, | ||
defaultContentType: params.defaultContentType, | ||
}; | ||
@@ -949,3 +950,2 @@ delete upDownFileParams.s3Params.Prefix; | ||
upDownFileParams.localFile = fullPath; | ||
upDownFileParams.localFileStat = null; | ||
var downloader = self.downloadFile(upDownFileParams); | ||
@@ -952,0 +952,0 @@ var prevAmountDone = 0; |
{ | ||
"name": "s3", | ||
"version": "4.1.0", | ||
"version": "4.1.1", | ||
"description": "high level amazon s3 client. upload and download files and directories", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -210,2 +210,7 @@ # High Level Amazon S3 Client | ||
* `localFile`: path to the file on disk you want to upload to S3. | ||
* (optional) `defaultContentType`: Unless you explicitly set the `ContentType` | ||
parameter in `s3Params`, it will be automatically set for you based on the | ||
file extension of `localFile`. If the extension is unrecognized, | ||
`defaultContentType` will be used instead. Defaults to | ||
`application/octet-stream`. | ||
@@ -280,5 +285,5 @@ The difference between using AWS SDK `putObject` and this one: | ||
* `recursive` - `true` or `false` whether or not you want to recurse | ||
into directories. | ||
* `s3Params` - params to pass to AWS SDK `listObjects`. | ||
* (optional) `recursive` - `true` or `false` whether or not you want to recurse | ||
into directories. Default `false`. | ||
@@ -351,10 +356,14 @@ Note that if you set `Delimiter` in `s3Params` then you will get a list of | ||
* `localDir` - source path on local file system to sync to S3 | ||
* `deleteRemoved` - delete s3 objects with no corresponding local file. | ||
default false | ||
* `getS3Params` - optional function which will be called for every file that | ||
needs to be uploaded. See below. | ||
* `followSymlinks` - defaults to `false` | ||
* `s3Params` | ||
- `Prefix` (required) | ||
- `Bucket` (required) | ||
* (optional) `deleteRemoved` - delete s3 objects with no corresponding local file. | ||
default false | ||
* (optional) `getS3Params` - function which will be called for every file that | ||
needs to be uploaded. See below. | ||
* (optional) `defaultContentType`: Unless you explicitly set the `ContentType` | ||
parameter in `s3Params`, it will be automatically set for you based on the | ||
file extension of `localFile`. If the extension is unrecognized, | ||
`defaultContentType` will be used instead. Defaults to | ||
`application/octet-stream`. | ||
@@ -415,8 +424,8 @@ ```js | ||
* `localDir` - destination directory on local file system to sync to | ||
* `deleteRemoved` - delete local files with no corresponding s3 object. default `false` | ||
* `getS3Params` - optional function which will be called for every object that | ||
needs to be downloaded. See below. | ||
* `s3Params` | ||
- `Prefix` (required) | ||
- `Bucket` (required) | ||
* (optional) `deleteRemoved` - delete local files with no corresponding s3 object. default `false` | ||
* (optional) `getS3Params` - function which will be called for every object that | ||
needs to be downloaded. See below. | ||
@@ -482,3 +491,3 @@ ```js | ||
* `Prefix` | ||
* `MFA` (optional) | ||
* (optional) `MFA` | ||
@@ -485,0 +494,0 @@ Returns an `EventEmitter` with these properties: |
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
62577
545